File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,17 +23,19 @@ permissions:
2323jobs :
2424 linux :
2525 name : Nightly Linux
26- if : github.repository_owner == 'NVIDIA'
26+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
2727 uses : ./.github/workflows/test_linux.yml
2828 windows :
2929 name : Nightly Windows
30- if : github.repository_owner == 'NVIDIA'
30+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
3131 uses : ./.github/workflows/test_windows.yml
3232 macos :
3333 name : Nightly MacOS
34- if : github.repository_owner == 'NVIDIA'
34+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
3535 uses : ./.github/workflows/test_macos.yml
36+ with :
37+ store-cache : true
3638 package_test :
3739 name : Nightly Packaging
38- if : github.repository_owner == 'NVIDIA'
40+ if : github.repository_owner == 'NVIDIA' || github.event_name == 'workflow_dispatch'
3941 uses : ./.github/workflows/remote_package_install.yml
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ permissions:
2323 security-events : none
2424 statuses : none
2525
26+ env :
27+ XDG_CACHE_HOME : ${{ github.workspace }}/.cache
28+
2629jobs :
2730 build :
2831 runs-on : ubuntu-latest
@@ -35,11 +38,22 @@ jobs:
3538 uses : actions/setup-python@v4
3639 with :
3740 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 : garak-test-resources-shared
50+
3851 - name : Install dependencies
3952 run : |
4053 python -m pip install --upgrade pip
4154 pip install -r requirements.txt
4255 python -m pip cache purge
56+
4357 - name : Test with pytest
4458 run : |
4559 python -m pytest tests/
Original file line number Diff line number Diff line change 77 pull_request :
88 workflow_dispatch :
99 workflow_call :
10+ inputs :
11+ store-cache :
12+ description : " Store resource cache"
13+ required : false
14+ type : boolean
15+
1016
1117permissions :
1218 actions : none
@@ -23,6 +29,9 @@ permissions:
2329 security-events : none
2430 statuses : none
2531
32+ env :
33+ XDG_CACHE_HOME : ${{ github.workspace }}/.cache
34+
2635jobs :
2736 build_macos :
2837 runs-on : macos-latest
3948 with :
4049 python-version : ${{ matrix.python-version }}
4150
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 : garak-test-resources-shared
59+
4260 - name : Install dependencies
4361 run : |
4462 brew install libmagic
5169 run : |
5270 cd garak
5371 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 : garak-test-resources-shared
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ permissions:
2323 security-events : none
2424 statuses : none
2525
26+ env :
27+ XDG_CACHE_HOME : ${{ github.workspace }}/.cache
28+
2629jobs :
2730 build_windows :
2831 runs-on : windows-latest
3942 with :
4043 python-version : ${{ matrix.python-version }}
4144
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 : garak-test-resources-shared
54+
4255 - name : Install dependencies
4356 run : |
4457 python -m pip install --upgrade pip
You can’t perform that action at this time.
0 commit comments