ci: sets up automated publishing with provenance #11
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: linting & test coverage - linux | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
CI: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
check: | |
strategy: | |
fail-fast: true | |
matrix: | |
node-version: | |
- 18.x | |
- 21.x | |
platform: | |
- ubuntu-latest | |
runs-on: ${{matrix.platform}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: cache node modules for ${{matrix.node-version}}@${{matrix.platform}} | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{matrix.node-version}}@${{matrix.platform}}-build-${{hashFiles('package.json')}} | |
restore-keys: | | |
${{matrix.node-version}}@${{matrix.platform}}-build- | |
- name: set up node ${{matrix.node-version}}@${{matrix.platform}} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: install & build | |
run: | | |
node --version | |
npm install | |
npm run build | |
- name: lint & forbidden dependency check (runs on one platform only) | |
run: | | |
node --version | |
npm run lint | |
npm run depcruise | |
if: matrix.platform == 'ubuntu-latest' && matrix.node-version == '18.x' | |
- name: test coverage | |
run: | | |
node --version | |
npm run test:cover | |
- name: report coverage to code climate (runs on one platform only) | |
if: matrix.node-version == '18.x' | |
uses: paambaati/codeclimate-action@v3.0.0 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_TEST_COVERAGE_ID }} |