File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,38 @@ 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 : ${{ runner.os }}-${{ 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/
57
+
58
+ - name : Prepare resources for cache
59
+ run : |
60
+ rm -rf ~/.cache/huggingface/hub/*facebook*
61
+ rm -rf ~/.cache/huggingface/hub/*Helsinki*
62
+
63
+ - name : Save test cache
64
+ if : steps.cache-artifacts-restore.outputs.cache-hit != 'true'
65
+ uses : actions/cache@v4
66
+ with :
67
+ path : |
68
+ ~/.cache/garak/data
69
+ ~/.cache/huggingface
70
+ !~/.cache/huggingface/hub/*facebook*
71
+ !~/.cache/huggingface/hub/*Helsinki*
72
+ key : ${{ runner.os }}-${{ 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
+ key : ${{ runner.os }}-${{ 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
+ key : ${{ runner.os }}-${{ 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
+ key : ${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
50
+
42
51
- name : Install dependencies
43
52
run : |
44
53
python -m pip install --upgrade pip
50
59
run : |
51
60
cd garak
52
61
python -m pytest tests/
62
+
63
+ - name : Prepare resources for cache
64
+ run : |
65
+ rm -rf ~/.cache/huggingface/hub/*facebook*
66
+ rm -rf ~/.cache/huggingface/hub/*Helsinki*
67
+
68
+ - name : Save test cache
69
+ if : steps.cache-artifacts-restore.outputs.cache-hit != 'true'
70
+ uses : actions/cache@v4
71
+ with :
72
+ path : |
73
+ ~/.cache/garak/data
74
+ ~/.cache/huggingface
75
+ !~/.cache/huggingface/hub/*facebook*
76
+ !~/.cache/huggingface/hub/*Helsinki*
77
+ key : ${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
You can’t perform that action at this time.
0 commit comments