Merge pull request #1744 from bcgov/hotfix/ALCS-2022 #504
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: Code Coverage | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test-alcs-frontend: | |
defaults: | |
run: | |
working-directory: alcs-frontend | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
node: ["20"] | |
name: Coverage Report ALCS Frontend - ${{ matrix.node }}/${{ matrix.platform }} | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@master | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm install | |
- run: npm run build | |
- run: npm run test:cov | |
- if: matrix.node == '20' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-alcs-frontend | |
path: ${{ github.workspace }}/alcs-frontend/coverage | |
retention-days: 1 | |
if-no-files-found: error | |
test-portal-frontend: | |
defaults: | |
run: | |
working-directory: portal-frontend | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
node: ["20"] | |
name: Coverage Report Portal Frontend - ${{ matrix.node }}/${{ matrix.platform }} | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@master | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm install | |
- run: npm run build | |
- run: npm run test:cov | |
- if: matrix.node == '20' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-portal-frontend | |
path: ${{ github.workspace }}/portal-frontend/coverage | |
retention-days: 1 | |
if-no-files-found: error | |
test-api: | |
defaults: | |
run: | |
working-directory: services | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
node: ["20"] | |
name: Coverage Report API - ${{ matrix.node }}/${{ matrix.platform }} | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@master | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm install | |
- run: npm run build | |
- run: npm run test:cov | |
- if: matrix.node == '20' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-api | |
path: ${{ github.workspace }}/services/coverage | |
if-no-files-found: error | |
retention-days: 1 | |
coverage: | |
needs: [test-alcs-frontend, test-portal-frontend, test-api] | |
name: Publish Coverage Reports | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/download-artifact@v2 | |
- run: find . | |
- uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: 3afdaf9ea2909da512cd49bd70113304aad3f6a3b84c4f1047c8ae0111817ab1 | |
with: | |
coverageLocations: | | |
${{ github.workspace }}/**/lcov.info:lcov | |
prefix: ${{ github.workplace }} |