Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiwei-homage committed Feb 21, 2024
1 parent aadbf63 commit 2ae4bf5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Calculate code coverage

on:
pull_request:
types:
- opened
branches:
- testing
- features/**
- production-fixes/**

jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node 20
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install
- name: Run tests and collect coverage
continue-on-error: true # To avoid failed test case terminate whole flow
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
verbose: true

0 comments on commit 2ae4bf5

Please sign in to comment.