Add codecov to web ci #39
Workflow file for this run
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: SUBMIT WEB CI | |
on: | |
pull_request: | |
branches: | |
- develop | |
paths: | |
- "submit-web/**" | |
push: | |
branches: | |
- develop | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./submit-web | |
jobs: | |
setup-job: | |
runs-on: ubuntu-20.04 | |
if: github.repository == 'bcgov/EPIC.submit' | |
steps: | |
- uses: actions/checkout@v2 | |
- run: "true" | |
linting: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install --legacy-peer-deps | |
- name: Lint | |
id: lint | |
run: | | |
npm run lint | |
testing: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install | |
- name: Test with Cypress | |
id: test | |
run: | | |
npx cypress run --component --headed --browser chrome \ | |
--record --reporter @cypress/code-coverage | |
coverage-upload: | |
needs: testing # This job depends on the testing job being completed | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Upload coverage to Codecov (using @cypress/code-coverage) | |
run: | | |
npx @cypress/code-coverage upload --token=${{ secrets.CODECOV_TOKEN }} | |
build-check: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install --legacy-peer-deps | |
- name: build to check strictness | |
id: build | |
run: | | |
npm run build --quiet || true |