@@ -2,32 +2,17 @@ name: Continuous Integration
2
2
on : push
3
3
jobs :
4
4
unit-tests :
5
- runs-on : ' ${{ matrix.os }}'
6
- strategy :
7
- matrix :
8
- os :
9
- - ubuntu-22.04
10
- node-version : [ 18.x, 20.x, 22.x ]
11
- steps :
12
- - uses : actions/checkout@v4
13
- - name : ' Install node.js ${{ matrix.node-version }}'
14
- uses : actions/setup-node@v4
15
- with :
16
- node-version : ' ${{ matrix.node-version }}'
17
- - name : Run unit tests
18
- run : |
19
- npm install
20
- npm run ci
5
+ uses : ./.github/workflows/_test.yml
21
6
npm-publish :
22
7
needs : unit-tests
23
- if : github.ref == 'refs/heads/master' && github.event_name == 'push '
8
+ if : github.ref == 'refs/heads/master' && needs.unit-tests.result == 'success '
24
9
runs-on : ubuntu-22.04
25
10
steps :
26
11
- uses : actions/checkout@v4
27
12
- name : Install Node.js
28
13
uses : actions/setup-node@v4
29
14
with :
30
- node-version : 16 .x
15
+ node-version : 20 .x
31
16
- name : Run semantic-release
32
17
env :
33
18
GH_TOKEN : ${{ secrets.GH_SEMANTIC_RELEASE_TOKEN }}
36
21
if [[ -n "$GH_TOKEN" && -n "$NPM_TOKEN" ]]; then
37
22
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash -
38
23
fi
39
- build-docker-images :
40
- # run this job if the unit tests passed and the npm-publish job was a success or was skipped
41
- # note: github actions won't run a job if you don't call one of the status check functions, so `always()` is called since it evalutes to `true`
42
- if : ${{ always() && needs.unit-tests.result == 'success' && (needs.npm-publish.result == 'success' || needs.npm-publish.result == 'skipped') }}
43
- needs : [unit-tests, npm-publish]
44
- runs-on : ubuntu-22.04
45
- steps :
46
- - uses : actions/checkout@v4
47
- - name : Build Docker images
48
- env :
49
- DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
50
- DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
51
- run : |
52
- curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -
0 commit comments