-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (77 loc) · 2.46 KB
/
main.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
# This is a GitHub workflow YAML file
# see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
#
# If you want to update this file it's recommended to use a YAML validator
# https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
# configured to validate with https://json.schemastore.org/github-workflow.json
#
# This workflow is responsible to perform various checks related to the codebase,
# For every push to main or on a pull request, it
# - ensures there is no eslint error on files
# - ensures there is no test failing
# - uploads code coverage from tests to codecov
#
# If all these steps are passing and there is a secrets.NPM_TOKEN and version in package.json
# is not already published, workflow published the package on npm.
name: main
on:
push:
branches:
- main
pull_request:
branches:
- "**"
jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, macos-12, windows-2022]
node: [18.12.1]
runs-on: ${{ matrix.os }}
name: test on ${{ matrix.os }} and node ${{ matrix.node }}
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install node modules
run: npm install
- name: Playwright installation
run: npm run playwright:install
- name: Install certificate
run: node ./scripts/install_certificate.mjs
- name: Run ESLint
run: npm run eslint
- name: Run tests
run: npm run test:coverage
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
# see "coverageJsonFileRelativeUrl" in scripts/test.mjs
files: ./.coverage/coverage.json
verbose: true
release:
needs: [test]
if: success() && github.event_name == 'push'
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-20.04
steps:
- name: Checkout ⬇️
uses: actions/checkout@v3
- name: Setup node 🔧
uses: actions/setup-node@v3
with:
node-version: "18.12.1"
- name: Install node modules ⬇️
run: npm install
- name: Build 🚧
run: npm run build:prod
- name: Deploy 🚀
# https://github.com/JamesIves/github-pages-deploy-action
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist