-
-
Notifications
You must be signed in to change notification settings - Fork 14
81 lines (77 loc) · 2.09 KB
/
CI.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
name: Build, Lint, Test and Deploy
on:
push:
branches:
- "*"
pull_request:
branches:
- master
release:
types:
- published
jobs:
build-lint-test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- 20
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
- name: Run Linter
run: npm run lint
- name: Build Code
run: npm run build
- name: Run Unit Tests
run: npm run test
- name: Generate Coverage Report
run: npm run coverage
- name: Upload Coverage Report
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: Test on ${{ matrix.os }}
coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build-lint-test
steps:
- name: Let Coveralls know that all tests have finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
publish:
name: Publish Github Action
needs:
- build-lint-test
- coverage
if: github.event_name == 'release'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Update Major Tag
run: |
MAJOR_VERSION=$(git describe --tags | grep -o "v[0-9]*")
git config --global user.name 'HaaLeo'
git config --global user.email '[email protected]'
git tag -afm "Updated tag $MAJOR_VERSION to $(git describe --tags)" $MAJOR_VERSION
git push --tags --force