-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.4 KB
/
unit-tests.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
name: Unit Tests
# Triggers the workflow on all pushes.
on: push
jobs:
# Main test job.
test:
name: "Tests"
runs-on: ubuntu-20.04
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install deps
run: |
. ./.env
yarn
- name: Test coverage
run: |
. ./.env
yarn coverage
- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage.json
verbose: true
notify-test-failure:
name: "Notify Test failure"
needs: test
uses: ./.github/workflows/notify.yml
secrets: inherit
if: ${{ failure() }}
with:
body-text: "`${{ github.repository }}` branch: `${{ github.ref_name }}` [failed](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) :boom:"
notify-test-success:
name: "Notify Test success"
needs: test
uses: ./.github/workflows/notify.yml
secrets: inherit
if: ${{ success() }}
with:
body-text: "`${{ github.repository }}` branch: `${{ github.ref_name }}` [tested successfully](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) :tada:"