Skip to content

Add coverage report, cache node modules #8

Add coverage report, cache node modules

Add coverage report, cache node modules #8

Workflow file for this run

name: Build - CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check-access:
runs-on: ubuntu-latest
outputs:
has-token-access: ${{ steps.check.outputs.has-token-access }}
steps:
- id: check
run: |
echo "has-token-access=$(if [[ '${{ github.event.pull_request.head.repo.fork }}' != 'true' && '${{ github.actor }}' != 'dependabot[bot]' ]]; then echo 'true'; else echo 'false'; fi)" >> $GITHUB_OUTPUT
install-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/configure-nodejs
with:
lookup-only: 'true' # We only want to lookup from the cache - if a hit, this job does nothing
build:
needs:
- install-deps
- check-access
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/configure-nodejs
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Upload code coverage
if: github.event_name == 'pull_request' && needs.check-access.outputs.has-token-access == 'true'
uses: ./.github/actions/coverage-report
with:
lcov-file: coverage/lcov.info
title: Node.js Code Coverage Report