1
1
name : CI
2
2
on :
3
3
push :
4
- branches :
5
- [
6
- ' +([0-9])?(.{+([0-9]),x}).x' ,
7
- ' main' ,
8
- ' next' ,
9
- ' next-major' ,
10
- ' beta' ,
11
- ' alpha' ,
12
- ' !all-contributors/**' ,
13
- ]
4
+ branches-ignore : ['all-contributors/**']
14
5
pull_request :
15
6
branches-ignore : ['all-contributors/**']
7
+
16
8
jobs :
17
9
validate :
18
10
runs-on : ubuntu-latest
11
+ if : >
12
+ github.event_name != 'pull_request' ||
13
+ github.event.pull_request.head.repo.fork
19
14
steps :
20
15
- name : ⬇️ Checkout repo
21
- uses : actions/checkout@v2
22
- - name : 📥 Download deps
23
- uses : bahmutov/npm-install@v1
16
+ uses : actions/checkout@v4
17
+ - id : restore
18
+ name : ♻️ Restore node_modules
19
+ uses : actions/cache/restore@v4
24
20
with :
25
- useLockFile : false
26
- install-command : yarn --silent
21
+ path : |
22
+ yarn.lock
23
+ node_modules
24
+ key : ${{ hashFiles('package.json') }}
25
+ restore-keys : ${{ hashFiles('package.json') }}-
26
+
27
+ - id : install
28
+ if : >
29
+ steps.restore.outputs.cache-matched-key == ''
30
+ name : 📥 Install deps
31
+ run : yarn
27
32
env :
28
33
HUSKY_SKIP_INSTALL : true
34
+ - if : >
35
+ steps.install.outcome == 'success'
36
+ name: ♻️ Save node_modules
37
+ uses: actions/cache/save@v4
38
+ with:
39
+ path: |
40
+ yarn.lock
41
+ node_modules
42
+ key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
29
43
30
44
- name : ✍ Lint
31
45
run : npm run lint
@@ -38,24 +52,30 @@ jobs:
38
52
- name : 🏗 Build
39
53
run : npm run build
40
54
41
- - name : ⬆️ Upload coverage report
42
- uses : codecov/codecov-action@v1
55
+ - name : ☂️ Upload coverage report
56
+ uses : codecov/codecov-action@v5
57
+ env :
58
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
43
59
44
60
release :
45
61
needs : validate
46
62
runs-on : ubuntu-latest
47
- if :
48
- ${{ github.repository == 'testing-library/user-event' &&
63
+ if : >
64
+ github.event_name == 'push' &&
65
+ github.repository == 'testing-library/user-event' &&
49
66
contains('refs/heads/main,refs/heads/beta,refs/heads/alpha', github.ref)
50
- && github.event_name == 'push' }}
51
67
steps :
52
68
- name : ⬇️ Checkout repo
53
- uses : actions/checkout@v2
54
- - name : 📥 Download deps
55
- uses : bahmutov/npm-install@v1
69
+ uses : actions/checkout@v4
70
+ - name : ♻️ Restore node_modules
71
+ uses : actions/cache/restore@v4
56
72
with :
57
- useLockFile : false
58
- install-command : yarn --silent
73
+ path : |
74
+ yarn.lock
75
+ node_modules
76
+ key : ${{ runner.os }}-${{ hashFiles('package.json') }}
77
+ - name : 📥 Install deps
78
+ run : yarn
59
79
env :
60
80
HUSKY_SKIP_INSTALL : true
61
81
64
84
65
85
- name : 🚀 Release
66
86
uses : ph-fritsche/action-release@v2
87
+ with :
88
+ dry : ${{ vars.RELEASE_DRY }}
67
89
env :
68
90
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
69
91
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments