forked from conwetlab/ngsijs
-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (108 loc) · 3.12 KB
/
unittests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Tests
on:
create:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
node-unit-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
# Current LTS version: v18
# Current Active version: v19
node-version: [14.x, 16.x, 18.x, 19.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: node-${{ matrix.node-version }}
path-to-lcov: build/coverage/library-node/lcov.info
parallel: true
browser-unit-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v3
- run: npm ci
- run: grunt ci
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: browsers
path-to-lcov: build/coverage/library/lcov/lcov.info
parallel: true
finish:
needs:
- node-unit-tests
- browser-unit-tests
runs-on: ubuntu-22.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
deploy:
needs:
- node-unit-tests
- browser-unit-tests
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
- name: Publish NPM 📦
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-doc:
needs:
- node-unit-tests
- browser-unit-tests
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: src
- name: Build jsdoc
working-directory: ./src
run: |
npm ci
grunt jsdoc
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
- name: Update gh-pages branch
run: |
rm -rf gh-pages/${{ steps.get_version.outputs.VERSION }}
mv src/dist/docs "gh-pages/${{ steps.get_version.outputs.VERSION }}"
cd gh-pages
ln -sfn "${{ steps.get_version.outputs.VERSION }}" latest
ln -sfn "${{ steps.get_version.outputs.VERSION }}" stable
git config user.name github-actions
git config user.email [email protected]
git add "${{ steps.get_version.outputs.VERSION }}" latest stable
git push