Skip to content

Commit c6bfe23

Browse files
committed
Build fix, GitHub workflow updated, Dependency updates
1 parent 7518966 commit c6bfe23

File tree

6 files changed

+585
-291
lines changed

6 files changed

+585
-291
lines changed

.github/workflows/ci.yaml

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,66 @@
11
name: ci
22
on: push
33

4+
env:
5+
NODE_VERSIONS: [16.x, 18.x]
6+
47
jobs:
58
build:
9+
name: Build
610
runs-on: self-hosted
7-
811
strategy:
9-
max-parallel: 1
1012
matrix:
11-
node-version: [16.x, 18.x]
12-
13+
node-version: ${{ env.NODE_VERSIONS }}
1314
steps:
14-
- uses: actions/checkout@v2
15+
- name: Checkout sources
16+
uses: actions/checkout@v2
1517
- name: Use Node.js ${{ matrix.node-version }}
1618
uses: actions/setup-node@v1
1719
with:
1820
node-version: ${{ matrix.node-version }}
19-
- run: npm ci
20-
- name: Create .env file
21+
- name: Installing dependencies
22+
run: npm ci
23+
- name: Building sources
24+
run: npm run build
25+
26+
lint:
27+
name: Lint Code
28+
needs: build
29+
runs-on: self-hosted
30+
strategy:
31+
matrix:
32+
node-version: ${{ env.NODE_VERSIONS }}
33+
steps:
34+
- name: Linting
35+
run: npm run lint
36+
env:
37+
CI: true
38+
39+
test_unit:
40+
name: Unit Tests
41+
needs: build
42+
runs-on: self-hosted
43+
strategy:
44+
matrix:
45+
node-version: ${{ env.NODE_VERSIONS }}
46+
steps:
47+
- name: Running unit tests
48+
run: npm run test:unit
49+
50+
test_integration:
51+
name: Integration Tests
52+
needs: build
53+
runs-on: self-hosted
54+
strategy:
55+
max-parallel: 1
56+
matrix:
57+
node-version: ${{ env.NODE_VERSIONS }}
58+
steps:
59+
- name: Creating `.env` file
2160
run: |
2261
touch .env
2362
echo HOST=${{ secrets.HOST }} >> .env
2463
echo EMAIL=${{ secrets.EMAIL }} >> .env
2564
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env
26-
- run: npm run build
27-
- run: npm run test:unit
28-
- run: npm run test:integration
29-
- run: npm run lint
30-
env:
31-
CI: true
65+
- name: Running integration tests
66+
run: npm run test:integration

.github/workflows/publish.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,62 @@ name: NPM publish
22
on: workflow_dispatch
33

44
jobs:
5-
publish:
5+
build:
6+
name: Build
67
runs-on: self-hosted
78
steps:
89
- name: Checkout sources
910
uses: actions/checkout@v2
10-
- name: Use Node.js 16
11-
uses: actions/setup-node@v2
11+
- name: Use Node.js 16.x.x
12+
uses: actions/setup-node@v1
1213
with:
1314
node-version: 16
14-
registry-url: https://registry.npmjs.org/
15-
- name: Install dependencies
15+
- name: Installing dependencies
1616
run: npm ci
17-
- name: Create .env file
17+
- name: Building sources
18+
run: npm run build
19+
20+
lint:
21+
name: Lint Code
22+
needs: build
23+
runs-on: self-hosted
24+
steps:
25+
- name: Linting
26+
run: npm run lint
27+
env:
28+
CI: true
29+
30+
test_unit:
31+
name: Unit Tests
32+
needs: build
33+
runs-on: self-hosted
34+
steps:
35+
- name: Running unit tests
36+
run: npm run test:unit
37+
38+
test_integration:
39+
name: Integration Tests
40+
needs: build
41+
runs-on: self-hosted
42+
steps:
43+
- name: Creating `.env` file
1844
run: |
1945
touch .env
2046
echo HOST=${{ secrets.HOST }} >> .env
2147
echo EMAIL=${{ secrets.EMAIL }} >> .env
2248
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env
49+
- name: Running integration tests
50+
run: npm run test:integration
51+
52+
publish:
53+
name: Publishing
54+
needs:
55+
- build
56+
- lint
57+
- test_unit
58+
- test_integration
59+
runs-on: self-hosted
60+
steps:
2361
- name: Publishing
2462
run: npm publish
2563
env:

0 commit comments

Comments
 (0)