@@ -3,50 +3,80 @@ name: CI
3
3
on :
4
4
push :
5
5
branches : [main]
6
+ pull_request :
7
+ branches : [main]
6
8
7
9
jobs :
8
- test :
10
+ main :
9
11
# ignore all-contributors PRs
10
12
if : ${{ !contains(github.head_ref, 'all-contributors') }}
11
-
12
- runs-on : ubuntu-latest
13
-
14
13
strategy :
15
14
matrix :
16
15
node : [10, 12, 14, 16]
17
-
16
+ runs-on : ubuntu-latest
18
17
steps :
19
- - name : Cancel previous runs
20
-
18
+ - name : 🛑 Cancel Previous Runs
19
+
20
+
21
+ - name : ⬇️ Checkout repo
22
+ uses : actions/checkout@v3
23
+
24
+ - name : ⎔ Setup node
25
+ uses : actions/setup-node@v3
26
+ with :
27
+ node-version : ${{ matrix.node }}
21
28
22
- - uses : actions/checkout@v2
29
+ - name : 📥 Download deps
30
+ uses : bahmutov/npm-install@v1
31
+ with :
32
+ useLockFile : false
23
33
24
- - name : Setup nodejs
25
- uses : actions/setup-node@v2
26
- with :
27
- node-version : ${{ matrix.node }}
28
- - name : Install deps & validate
29
- run : npm run setup
34
+ - name : ▶️ Run validate script
35
+ run : npm run validate
36
+
37
+ - name : ⬆️ Upload coverage report
38
+ uses : codecov/codecov-action@v2
30
39
31
40
release :
41
+ needs : main
32
42
runs-on : ubuntu-latest
33
-
43
+ if :
44
+ ${{ github.repository == 'testing-library/svelte-testing-library' &&
45
+ contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
46
+ github.ref) && github.event_name == 'push' }}
34
47
steps :
35
- - name : Cancel previous runs
36
-
37
-
38
- - uses : actions/checkout@v2
39
-
40
- - name : Setup nodejs
41
- uses : actions/setup-node@v2
42
- with :
43
- node-version : 14
44
- - name : Install deps
45
- run : npm install
46
- - name : Build proj
47
- run : npm run build
48
- - name : Update tests, coverage, and release
49
- run : npm run test:update && npx codecov && npx semantic-release
50
- env :
51
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
52
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
+ - name : 🛑 Cancel Previous Runs
49
+
50
+
51
+ - name : ⬇️ Checkout repo
52
+ uses : actions/checkout@v3
53
+
54
+ - name : ⎔ Setup node
55
+ uses : actions/setup-node@v3
56
+ with :
57
+ node-version : 16
58
+
59
+ - name : 📥 Download deps
60
+ uses : bahmutov/npm-install@v1
61
+ with :
62
+ useLockFile : false
63
+
64
+ - name : 🏗 Run build script
65
+ run : npm run build
66
+
67
+ - name : 🚀 Release
68
+ uses : cycjimmy/semantic-release-action@v2
69
+ with :
70
+ semantic_version : 17
71
+ branches : |
72
+ [
73
+ '+([0-9])?(.{+([0-9]),x}).x',
74
+ 'main',
75
+ 'next',
76
+ 'next-major',
77
+ {name: 'beta', prerelease: true},
78
+ {name: 'alpha', prerelease: true}
79
+ ]
80
+ env :
81
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
82
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments