Files
npm-audit-action/.github/workflows/test.yml
dependabot[bot] 148449c0eb build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 13:31:42 +00:00

108 lines
3.1 KiB
YAML

name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
jobs:
build: # make sure build/ci work properly
strategy:
matrix:
node: [20]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies and run tests
run: |
npm ci
npm run test:coverage
- name: Upload coverage to Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
build-on-windows:
strategy:
matrix:
node: [20]
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies and run tests
run: |
npm ci
npm run test
test: # make sure the action works on a clean machine without building
strategy:
matrix:
node: [20]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Run npm audit action
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
issue_title: npm audit run by test job
create_issues: false
production_flag: true
- name: Run npm audit action in testdata workdir
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
working_directory: __tests__/testdata/workdir
create_issues: false
production_flag: true
# test-on-windows:
# strategy:
# matrix:
# node: [20]
# runs-on: windows-latest
# steps:
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
# - uses: actions/checkout@v5
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# # Set PowerShell execution policy for this process
# - name: Set PowerShell execution policy
# shell: powershell
# run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
# # Node.js 20 already includes a recent npm version, so npm upgrade is not needed
# - name: Run npm audit action
# uses: ./
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# issue_title: npm audit run by test job
# create_issues: false
# production_flag: true
# - name: Run npm audit action in testdata workdir
# uses: ./
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# working_directory: __tests__/testdata/workdir
# create_issues: false
# production_flag: true