Running tests for refs/pull/114/merge #154
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: test | |
run-name: Running tests for ${{ github.ref }} | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_call: | |
secrets: | |
CC_TEST_REPORTER_ID: | |
description: "Code Climate Test Reporter ID to publish test results to Code Climate." | |
required: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ./.nvmrc | |
cache: npm | |
- name: Install NPM Packages | |
run: npm ci | |
- name: Generate Test Data | |
run: npm run test:generate-data | |
- name: Run Tests & Publish Coverage to Code Climate | |
uses: paambaati/codeclimate-action@v8 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
if: ${{ env.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: npm run test:cov |