ci: enable pipeline publishing #148
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: CI | ||
Check failure on line 1 in .github/workflows/ci.yaml GitHub Actions / CIInvalid workflow file
|
||
on: | ||
push: | ||
branches: [v9] | ||
pull_request: | ||
branches: [v9] | ||
workflow_call: | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
needs: code-lint | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-24.04 | ||
- macos-13 | ||
- windows-2022 | ||
node-version: | ||
- 8 | ||
- 9 | ||
- 10 | ||
- 11 | ||
- 12 | ||
- 13 | ||
- 14 | ||
- 15 | ||
- 16 | ||
- 17 | ||
- 18 | ||
- 19 | ||
- 20 | ||
- 21 | ||
- 22 | ||
- 23 | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
nodejs.org:443 | ||
objects.githubusercontent.com:443 | ||
registry.npmjs.org:443 | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Dependencies | ||
if: matrix.node-version != 9 | ||
run: npm ci --ignore-scripts | ||
- name: Install Dependencies (Node.js v9) | ||
if: matrix.node-version == 9 | ||
run: npm install | ||
- name: Run Tests | ||
if: ! startsWith(matrix.os, 'windows-') | ||
run: npm test --ignore-scripts | ||
- name: Run Tests (Windows) | ||
if: startsWith(matrix.os, 'windows-') | ||
shell: cmd | ||
run: npm run --ignore-scripts test-windows | ||
- name: Publish Coverage | ||
if: startsWith(matrix.os, 'ubuntu-') && matrix.node-version == 22 # LTS | ||
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
code-lint: | ||
name: Code Lint | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
registry.npmjs.org:443 | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
with: | ||
node-version: 22 # LTS | ||
- name: Install Dependencies | ||
run: npm ci --ignore-scripts | ||
- name: Lockfile Lint | ||
run: | | ||
npm exec \ | ||
--no-install \ | ||
--package=lockfile-lint \ | ||
-- \ | ||
lockfile-lint \ | ||
--allowed-hosts=npm \ | ||
--path=./package-lock.json \ | ||
--validate-https \ | ||
--validate-package-names |