Skip to content

Adds notifications to CI workflow. #296

Adds notifications to CI workflow.

Adds notifications to CI workflow. #296

Workflow file for this run

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:"