11name : CI
22on :
33 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/**']
145 pull_request :
156 branches-ignore : ['all-contributors/**']
7+
168jobs :
179 validate :
1810 runs-on : ubuntu-latest
11+ if : >
12+ github.event_name != 'pull_request' ||
13+ github.event.pull_request.head.repo.fork
1914 steps :
2015 - 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
2420 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
2732 env :
2833 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') }}
2943
3044 - name : ✍ Lint
3145 run : npm run lint
@@ -38,24 +52,30 @@ jobs:
3852 - name : 🏗 Build
3953 run : npm run build
4054
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 }}
4359
4460 release :
4561 needs : validate
4662 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' &&
4966 contains('refs/heads/main,refs/heads/beta,refs/heads/alpha', github.ref)
50- && github.event_name == 'push' }}
5167 steps :
5268 - 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
5672 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
5979 env :
6080 HUSKY_SKIP_INSTALL : true
6181
6484
6585 - name : 🚀 Release
6686 uses : ph-fritsche/action-release@v2
87+ with :
88+ dry : ${{ vars.RELEASE_DRY }}
6789 env :
6890 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6991 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments