File tree Expand file tree Collapse file tree 4 files changed +66
-4
lines changed Expand file tree Collapse file tree 4 files changed +66
-4
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,19 @@ permissions:
23
23
jobs :
24
24
linux :
25
25
name : Nightly Linux
26
- if : github.repository_owner == 'NVIDIA'
26
+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
27
27
uses : ./.github/workflows/test_linux.yml
28
28
windows :
29
29
name : Nightly Windows
30
- if : github.repository_owner == 'NVIDIA'
30
+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
31
31
uses : ./.github/workflows/test_windows.yml
32
32
macos :
33
33
name : Nightly MacOS
34
- if : github.repository_owner == 'NVIDIA'
34
+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
35
35
uses : ./.github/workflows/test_macos.yml
36
+ with :
37
+ store-cache : true
36
38
package_test :
37
39
name : Nightly Packaging
38
- if : github.repository_owner == 'NVIDIA'
40
+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
39
41
uses : ./.github/workflows/remote_package_install.yml
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ permissions:
23
23
security-events : none
24
24
statuses : none
25
25
26
+ env :
27
+ XDG_CACHE_HOME : ${{ github.workspace }}/.cache
28
+
26
29
jobs :
27
30
build :
28
31
runs-on : ubuntu-latest
@@ -35,11 +38,22 @@ jobs:
35
38
uses : actions/setup-python@v4
36
39
with :
37
40
python-version : ${{ matrix.python-version }}
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-shared
50
+
38
51
- name : Install dependencies
39
52
run : |
40
53
python -m pip install --upgrade pip
41
54
pip install -r requirements.txt
42
55
python -m pip cache purge
56
+
43
57
- name : Test with pytest
44
58
run : |
45
59
python -m pytest tests/
Original file line number Diff line number Diff line change 7
7
pull_request :
8
8
workflow_dispatch :
9
9
workflow_call :
10
+ inputs :
11
+ store-cache :
12
+ description : " Store resource cache"
13
+ required : false
14
+ type : boolean
15
+
10
16
11
17
permissions :
12
18
actions : none
@@ -23,6 +29,9 @@ permissions:
23
29
security-events : none
24
30
statuses : none
25
31
32
+ env :
33
+ XDG_CACHE_HOME : ${{ github.workspace }}/.cache
34
+
26
35
jobs :
27
36
build_macos :
28
37
runs-on : macos-latest
39
48
with :
40
49
python-version : ${{ matrix.python-version }}
41
50
51
+ - name : Restore test cache artifacts
52
+ id : cache-artifacts-restore
53
+ uses : actions/cache/restore@v4
54
+ with :
55
+ path : |
56
+ .cache/garak/data
57
+ .cache/huggingface
58
+ key : hf-cache-shared
59
+
42
60
- name : Install dependencies
43
61
run : |
44
62
brew install libmagic
51
69
run : |
52
70
cd garak
53
71
python -m pytest tests/
72
+
73
+ - name : Prepare resources for cache
74
+ run : |
75
+ rm -rf .cache/huggingface/hub/*facebook*
76
+ rm -rf .cache/huggingface/hub/*Helsinki*
77
+
78
+ - name : Save test cache
79
+ if : inputs.store-cache
80
+ uses : actions/cache@v4
81
+ with :
82
+ path : |
83
+ .cache/garak/data
84
+ .cache/huggingface
85
+ enableCrossOsArchive : true
86
+ key : hf-cache-shared
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ permissions:
23
23
security-events : none
24
24
statuses : none
25
25
26
+ env :
27
+ XDG_CACHE_HOME : ${{ github.workspace }}/.cache
28
+
26
29
jobs :
27
30
build_windows :
28
31
runs-on : windows-latest
39
42
with :
40
43
python-version : ${{ matrix.python-version }}
41
44
45
+ - name : Restore test cache artifacts
46
+ id : cache-artifacts-restore
47
+ uses : actions/cache/restore@v4
48
+ with :
49
+ path : |
50
+ .cache/garak/data
51
+ .cache/huggingface
52
+ enableCrossOsArchive : true
53
+ key : hf-cache-shared
54
+
42
55
- name : Install dependencies
43
56
run : |
44
57
python -m pip install --upgrade pip
You can’t perform that action at this time.
0 commit comments