@@ -2,88 +2,88 @@ name: CI
2
2
3
3
on : [push, pull_request]
4
4
jobs :
5
- unit_test :
6
- strategy :
7
- fail-fast : false
8
- matrix :
9
- os : [ubuntu-latest, windows-2019]
10
- node : [12, 14, 16, 18]
11
-
12
- runs-on : ${{ matrix.os }}
13
- steps :
14
- - uses : actions/checkout@v3
15
- - uses : actions/setup-node@v3
16
- with :
17
- node-version : ${{ matrix.node }}
18
-
19
- - name : Install nodejs dependencies
20
- run : npm ci
21
-
22
- - name : Build TS
23
- run : npm run build
24
-
25
- - name : Run tests
26
- run : npm run test
27
-
28
- integration_test :
29
- strategy :
30
- fail-fast : false
31
- matrix :
32
- os : [ubuntu-latest, windows-2019]
33
- version : [' 0.1', ' 0.2', ' development' ]
34
- node : [14, 18]
35
-
36
- runs-on : ${{ matrix.os }}
37
- steps :
38
- - uses : actions/checkout@v3
39
- - uses : actions/setup-node@v3
40
- with :
41
- node-version : ${{ matrix.node }}
42
-
43
- - name : Install system dependencies
44
- if : matrix.os == 'ubuntu-latest'
45
- run : sudo apt update && sudo apt-get -y install libusb-1.0-0-dev libasound2-dev libudev-dev
46
-
47
- - name : Upgrade npm
48
-
49
-
50
- - name : Install node native development files
51
- shell : bash
52
- run : npx node-gyp install
53
-
54
- - name : Install nodejs dependencies
55
- run : npm ci
56
-
57
- - name : Build
58
- run : npm run build && npm link
59
-
60
- - name : Run integration test
61
- shell : bash
62
- run : ./integration_test.sh ${{ matrix.version }}
63
-
64
- release :
65
- name : Release
66
- runs-on : ubuntu-latest
67
- # not run for dependabot because it shouldn't trigger releases and has no write tokens
68
- # not run in forks because they are missing secrets too
69
- # only run for the main branch
70
- if : github.actor != 'dependabot[bot]' && startsWith(github.repository, 'codeoverflow-org') && github.ref == 'refs/heads/main'
71
- needs :
72
- - unit_test
73
- - integration_test
74
- steps :
75
- - name : Checkout
76
- uses : actions/checkout@v3
77
- - name : Setup Node.js
78
- uses : actions/setup-node@v3
79
- with :
80
- node-version : 18
81
-
82
- - name : Install dependencies
83
- run : npm ci
84
-
85
- - name : Release
86
- env :
87
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
89
- run : npx semantic-release
5
+ unit_test :
6
+ strategy :
7
+ fail-fast : false
8
+ matrix :
9
+ os : [ubuntu-latest, windows-2019]
10
+ node : [14, 16, 18]
11
+
12
+ runs-on : ${{ matrix.os }}
13
+ steps :
14
+ - uses : actions/checkout@v3
15
+ - uses : actions/setup-node@v3
16
+ with :
17
+ node-version : ${{ matrix.node }}
18
+
19
+ - name : Install nodejs dependencies
20
+ run : npm ci
21
+
22
+ - name : Build TS
23
+ run : npm run build
24
+
25
+ - name : Run tests
26
+ run : npm run test
27
+
28
+ integration_test :
29
+ strategy :
30
+ fail-fast : false
31
+ matrix :
32
+ os : [ubuntu-latest, windows-2019]
33
+ version : [" 0.1", " 0.2", " development" ]
34
+ node : [14, 18]
35
+
36
+ runs-on : ${{ matrix.os }}
37
+ steps :
38
+ - uses : actions/checkout@v3
39
+ - uses : actions/setup-node@v3
40
+ with :
41
+ node-version : ${{ matrix.node }}
42
+
43
+ - name : Install system dependencies
44
+ if : matrix.os == 'ubuntu-latest'
45
+ run : sudo apt update && sudo apt-get -y install libusb-1.0-0-dev libasound2-dev libudev-dev
46
+
47
+ - name : Upgrade npm
48
+
49
+
50
+ - name : Install node native development files
51
+ shell : bash
52
+ run : npx node-gyp install
53
+
54
+ - name : Install nodejs dependencies
55
+ run : npm ci
56
+
57
+ - name : Build
58
+ run : npm run build && npm link
59
+
60
+ - name : Run integration test
61
+ shell : bash
62
+ run : ./integration_test.sh ${{ matrix.version }}
63
+
64
+ release :
65
+ name : Release
66
+ runs-on : ubuntu-latest
67
+ # not run for dependabot because it shouldn't trigger releases and has no write tokens
68
+ # not run in forks because they are missing secrets too
69
+ # only run for the main branch
70
+ if : github.actor != 'dependabot[bot]' && startsWith(github.repository, 'codeoverflow-org') && github.ref == 'refs/heads/main'
71
+ needs :
72
+ - unit_test
73
+ - integration_test
74
+ steps :
75
+ - name : Checkout
76
+ uses : actions/checkout@v3
77
+ - name : Setup Node.js
78
+ uses : actions/setup-node@v3
79
+ with :
80
+ node-version : 18
81
+
82
+ - name : Install dependencies
83
+ run : npm ci
84
+
85
+ - name : Release
86
+ env :
87
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
89
+ run : npx semantic-release
0 commit comments