-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.21 KB
/
Copy pathlinux.yml
File metadata and controls
83 lines (70 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Cache Dependencies
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache apt dependencies
id: apt-cache
uses: actions/cache@v4
with:
path: /tmp/apt-cache
key: apt-cache-{{ runner.os }}-{{ hashFiles('**/dependencies.sh') }}
restore-keys: |
apt-cache-{{ runner.os }}-
- name: Cache pip dependencies
id: pip-cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-cache-{{ runner.os }}-{{ hashFiles('**/requirements.txt') }}
- name: Cache npm dependencies
id: npm-cache
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-cache-{{ runner.os }}-{{ hashFiles('package-lock.json') }}
- name: Run dependencies.sh script
run: |
chmod +x .github/workflows/dependencies.sh
.github/workflows/dependencies.sh
use_cache:
runs-on: ubuntu-latest
needs: build # This job depends on the "build" job and will use its cache.
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Restore apt cache
uses: actions/cache@v4
with:
path: /tmp/apt-cache
key: apt-cache-{{ runner.os }}-{{ hashFiles('**/dependencies.sh') }}
restore-keys: |
apt-cache-{{ runner.os }}-
- name: Restore pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-cache-{{ runner.os }}-{{ hashFiles('**/requirements.txt') }}
restore-keys: |
pip-cache-{{ runner.os }}-
- name: Restore npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-cache-{{ runner.os }}-{{ hashFiles('package-lock.json') }}
restore-keys: |
npm-cache-{{ runner.os }}-
- name: Run tests (or other build steps)
run: |
# Add commands to run tests or other steps that require the dependencies
echo "Using cached dependencies successfully!"