Skip to content

Commit

Permalink
Add test and coverage job
Browse files Browse the repository at this point in the history
  • Loading branch information
aialok committed Jul 31, 2024
1 parent cc8fa38 commit 8173496
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request:
types: [opened, reopened, synchronize]

env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}

jobs:
code-quality-checks:
name: Code Quality Checks
Expand Down Expand Up @@ -91,3 +94,36 @@ jobs:
echo "$file is unauthorized to change/delete"
done
exit 1
testing-and-coverage:
name: Testing and Coverage
needs: [code-quality-checks]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run development server
run: yarn run dev &

- name: Run tests and generate coverage report
run: yarn run test:coverage:all

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ env.CODECOV_UNIQUE_NAME }}
verbose: true
fail_ci_if_error: true

0 comments on commit 8173496

Please sign in to comment.