Skip to content

Commit 03b60b4

Browse files
committed
gitlab-ci: Cache Python dependencies
1 parent 67b191f commit 03b60b4

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

.gitlab-ci.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,40 @@ variables:
1212
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/pack/gcc-9.2.0-af/linux-x64/bin/gcc
1313
LLVM_SYS_120_PREFIX: /usr/pack/llvm-12.0.1-af
1414
CMAKE: cmake-3.18.1
15+
# Override pip cache directory
16+
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
17+
18+
default:
19+
before_script:
20+
source iis-setup.sh
21+
cache: &global_cache
22+
key:
23+
files:
24+
- pyproject.toml
25+
paths:
26+
- .cache/pip
27+
policy: pull
28+
1529

16-
before_script:
17-
source iis-setup.sh
30+
#########
31+
# Setup #
32+
#########
33+
34+
setup:
35+
cache:
36+
# inherit all global cache settings
37+
<<: *global_cache
38+
# override the policy
39+
policy: pull-push
40+
script:
41+
- echo "Setup completed."
1842

1943
##############
2044
# Build docs #
2145
##############
2246

2347
docs:
48+
needs: [setup]
2449
script:
2550
- make docs
2651

@@ -29,6 +54,7 @@ docs:
2954
#####################
3055

3156
pytest:
57+
needs: [setup]
3258
script:
3359
- pytest
3460

@@ -37,6 +63,7 @@ pytest:
3763
#################################
3864

3965
snitch-cluster-sw:
66+
needs: [setup]
4067
script:
4168
- cd target/snitch_cluster
4269
- make sw
@@ -46,6 +73,7 @@ snitch-cluster-sw:
4673
expire_in: 1 day
4774

4875
snitch-cluster-sw-banshee:
76+
needs: [setup]
4977
script:
5078
- cd target/snitch_cluster
5179
- make SELECT_RUNTIME=banshee sw
@@ -65,7 +93,7 @@ snitch-cluster-sw-banshee:
6593
# - snitch_dma
6694
# - snitch
6795
snitch-ip-tests:
68-
needs: []
96+
needs: [setup]
6997
parallel:
7098
matrix:
7199
- IP:
@@ -85,23 +113,23 @@ snitch-ip-tests:
85113

86114
# Verilator
87115
snitch-cluster-vlt:
88-
needs: [snitch-cluster-sw]
116+
needs: [setup, snitch-cluster-sw]
89117
script:
90118
- cd target/snitch_cluster
91119
- make bin/snitch_cluster.vlt
92120
- ./util/run.py sw/run.yaml --simulator verilator -j --run-dir runs/vlt
93121

94122
# VCS
95123
snitch-cluster-vcs:
96-
needs: [snitch-cluster-sw]
124+
needs: [setup, snitch-cluster-sw]
97125
script:
98126
- cd target/snitch_cluster
99127
- make bin/snitch_cluster.vcs
100128
- ./util/run.py sw/run.yaml --simulator vcs -j --run-dir runs/vcs
101129

102130
# Questa
103131
snitch-cluster-vsim:
104-
needs: [snitch-cluster-sw]
132+
needs: [setup, snitch-cluster-sw]
105133
script:
106134
- cd target/snitch_cluster
107135
- make bin/snitch_cluster.vsim
@@ -114,7 +142,7 @@ snitch-cluster-vsim:
114142

115143
# Banshee
116144
snitch-cluster-banshee:
117-
needs: [snitch-cluster-sw-banshee]
145+
needs: [setup, snitch-cluster-sw-banshee]
118146
variables:
119147
SNITCH_LOG: info
120148
script:
@@ -130,6 +158,7 @@ snitch-cluster-banshee:
130158

131159
# Tests requiring hardware FDIV unit
132160
snitch-cluster-fdiv-vsim:
161+
needs: [setup]
133162
script:
134163
- cd target/snitch_cluster
135164
- make CFG_OVERRIDE=cfg/fdiv.json sw
@@ -140,6 +169,7 @@ snitch-cluster-fdiv-vsim:
140169

141170
# Test OmegaNet TCDM interconnect
142171
snitch-cluster-omega-vsim:
172+
needs: [setup]
143173
script:
144174
- cd target/snitch_cluster
145175
- make CFG_OVERRIDE=cfg/omega.json sw
@@ -148,6 +178,7 @@ snitch-cluster-omega-vsim:
148178

149179
# Test Multi-channel DMA
150180
snitch-cluster-mchan-vsim:
181+
needs: [setup]
151182
script:
152183
- cd target/snitch_cluster
153184
- make CFG_OVERRIDE=cfg/dma_mchan.json sw
@@ -159,6 +190,7 @@ snitch-cluster-mchan-vsim:
159190
############
160191

161192
nonfree:
193+
needs: [setup]
162194
script:
163195
- make nonfree
164196
- make elab

0 commit comments

Comments
 (0)