File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,22 @@ jobs:
35
35
uses : actions/setup-python@v4
36
36
with :
37
37
python-version : ${{ matrix.python-version }}
38
+
39
+ - name : Restore test cache artifacts
40
+ id : cache-artifacts-restore
41
+ uses : actions/cache/restore@v4
42
+ with :
43
+ path : |
44
+ ~/.cache/garak/data
45
+ ~/.cache/huggingface
46
+ key : hf-cache-${{ hashFiles('**/pyproject.toml') }}
47
+
38
48
- name : Install dependencies
39
49
run : |
40
50
python -m pip install --upgrade pip
41
51
pip install -r requirements.txt
42
52
python -m pip cache purge
53
+
43
54
- name : Test with pytest
44
55
run : |
45
56
python -m pytest tests/
Original file line number Diff line number Diff line change 39
39
with :
40
40
python-version : ${{ matrix.python-version }}
41
41
42
+ - name : Restore test cache artifacts
43
+ id : cache-artifacts-restore
44
+ uses : actions/cache/restore@v4
45
+ with :
46
+ path : |
47
+ ~/.cache/garak/data
48
+ ~/.cache/huggingface
49
+ key : hf-cache--${{ hashFiles('**/pyproject.toml') }}
50
+
42
51
- name : Install dependencies
43
52
run : |
44
53
brew install libmagic
51
60
run : |
52
61
cd garak
53
62
python -m pytest tests/
63
+
64
+ - name : Prepare resources for cache
65
+ run : |
66
+ rm -rf ~/.cache/huggingface/hub/*facebook*
67
+ rm -rf ~/.cache/huggingface/hub/*Helsinki*
68
+
69
+ - name : Save test cache
70
+ if : steps.cache-artifacts-restore.outputs.cache-hit != 'true'
71
+ uses : actions/cache@v4
72
+ with :
73
+ path : |
74
+ ~/.cache/garak/data
75
+ ~/.cache/huggingface
76
+ enableCrossOsArchive : true
77
+ key : hf-cache-${{ hashFiles('**/pyproject.toml') }}
Original file line number Diff line number Diff line change 39
39
with :
40
40
python-version : ${{ matrix.python-version }}
41
41
42
+ - name : Restore test cache artifacts
43
+ id : cache-artifacts-restore
44
+ uses : actions/cache/restore@v4
45
+ with :
46
+ path : |
47
+ ~/.cache/garak/data
48
+ ~/.cache/huggingface
49
+ enableCrossOsArchive : true
50
+ key : hf-cache-${{ hashFiles('**/pyproject.toml') }}
51
+
42
52
- name : Install dependencies
43
53
run : |
44
54
python -m pip install --upgrade pip
You can’t perform that action at this time.
0 commit comments