@@ -3,7 +3,9 @@ name: CPU tests
3
3
on :
4
4
push :
5
5
branches : [main]
6
- pull_request : {}
6
+ pull_request_target :
7
+ branches : [main]
8
+ types : [opened, reopened, ready_for_review, labeled, synchronize]
7
9
workflow_dispatch : {}
8
10
9
11
concurrency :
31
33
timeout-minutes : 10
32
34
steps :
33
35
- uses : actions/checkout@v4
36
+ if : github.event_name != 'pull_request'
37
+ - uses : actions/checkout@v4
38
+ if : github.event_name == 'pull_request'
39
+ with :
40
+ ref : ${{ github.event.pull_request.head.sha }}
34
41
- uses : actions/setup-python@v5
35
42
with :
36
43
python-version : ${{ matrix.python-version }}
@@ -59,27 +66,33 @@ jobs:
59
66
os : ["ubuntu-22.04"]
60
67
python-version : ["3.9", "3.10", "3.11"]
61
68
include :
62
- - { os: "macOS-14", python-version: "3.9" } # without Thunder
63
- - { os: "windows-2022", python-version: "3.9" } # without Thunder
69
+ - { os: "macOS-14", python-version: "3.9" }
70
+ - { os: "windows-2022", python-version: "3.9" }
64
71
timeout-minutes : 25
65
72
steps :
66
73
- uses : actions/checkout@v4
74
+ if : github.event_name != 'pull_request'
75
+ - uses : actions/checkout@v4
76
+ if : github.event_name == 'pull_request'
77
+ with :
78
+ ref : ${{ github.event.pull_request.head.sha }}
67
79
- uses : actions/setup-python@v5
68
80
with :
69
81
python-version : ${{ matrix.python-version }}
70
82
cache : " pip"
71
83
cache-dependency-path : pyproject.toml
72
84
73
85
# Add caching for HF models and tokenizers
74
- - name : Restore HF cache
75
- uses : actions/cache/restore@v3
86
+ - name : HF cache
87
+ uses : actions/cache@v3
88
+ continue-on-error : true
76
89
with :
77
90
path : .cache-HF
78
- key : |
91
+ key : hf-cache-${{ runner.os }}-${{ matrix.python-version }}
92
+ restore-keys : |
79
93
hf-cache-${{ runner.os }}-${{ matrix.python-version }}
80
94
hf-cache-${{ runner.os }}-
81
95
hf-cache-
82
- fail-on-cache-miss : false
83
96
84
97
- name : Install dependencies
85
98
run : |
@@ -96,13 +109,6 @@ jobs:
96
109
pip install -q py-tree
97
110
python -m py_tree -d 1 .cache-HF
98
111
99
- - name : Dump HF cache
100
- if : github.event_name != 'pull_request'
101
- uses : actions/cache/save@v3
102
- with :
103
- path : .cache-HF
104
- key : hf-cache-${{ runner.os }}-${{ matrix.python-version }}
105
-
106
112
testing-guardian :
107
113
runs-on : ubuntu-latest
108
114
needs : [pytester, testing-imports]
0 commit comments