feat: add coverage to github ci #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'coverage' | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Node | |
run: | | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
nvm install | |
nvm use | |
node -v | |
npm install | |
- name: Install gucci | |
run: | | |
GUCCI_VERSION="1.6.13" | |
curl -L -o gucci https://github.com/noqcks/gucci/releases/download/v${GUCCI_VERSION}/gucci-v${GUCCI_VERSION}-linux-amd64 | |
chmod +x gucci | |
sudo mv gucci /usr/local/bin/ | |
- name: Run tests | |
run: | | |
npm run test:ts -- --runInBand --ci --json --coverage --testLocationInResults --outputFile=report.json | |
- uses: ArtiomTr/jest-coverage-report-action@v2 | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
with: | |
test-script: npm run test:ts -- --runInBand --logHeapUsage | |
skip-step: all | |
coverage-file: report.json | |
base-coverage-file: report.json |