Skip to content

build(deps): bump the npm-dependencies group across 1 directory with … #880

build(deps): bump the npm-dependencies group across 1 directory with …

build(deps): bump the npm-dependencies group across 1 directory with … #880

Workflow file for this run

name: Node.js CI
on:
push:
# do not run on branches listed in npm-release.yml
branches-ignore: [main, develop, 3.x]
pull_request:
workflow_call:
secrets:
GH_TOKEN:
description: |
This GitHub job token or Classic PAT is used to authorize `dotnet nuget push` tests.
The required permissions are `packages: write` for job tokens and `write:packages` for Classic PATs and OAuth tokens.
See:
- https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages
- https://docs.github.com/en/apps/oauth-apps/`ing-oauth-apps/scopes-for-oauth-apps#available-scopes
- https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action
GL_TOKEN:
description: |
A GitLab API token with permission to push packages to the
repo IDed by CI_PROJECT_ID e.g. 70884695 for HaloSPV3/HCE.Shared.
NUGET_TOKEN:
description: A NugGet.org API token with permission to push to the unlisted package https://www.nuget.org/packages/HCE.Shared.DeterministicNupkg.
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read # access to check out code and install dependencies
id-token: write
packages: write
env:
CI_PROJECT_ID: 70884695
DOTNET_NOLOGO: true
# https://stackoverflow.com/questions/75180149/how-to-cache-dotnet-installation-in-github-actions
# access to "usr/lib/dotnet" is denied
DOTNET_INSTALL_DIR: /usr/share/dotnet
DOTNET_ROOT: /usr/share/dotnet
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
cache: npm
node-version-file: package.json
check-latest: true
- uses: actions/setup-dotnet@v5
with:
# required by Kuinox.NupkgDeterministicator
dotnet-version: 6.x
global-json-file: ./global.json
- run: npm i -g npm@latest
- run: npm ci
- run: npm audit signatures
- run: npm pack
- run: npm run type
- run: npm run lint:check
- run: |
# Try three times. Retries are in case lockfile permissions cause issues possibly due to race condition.
(echo "--- test:cacheSampleProjects (try 1/3) ---" && npm run test:cacheSampleProjects) || \
(echo "--- test:cacheSampleProjects (try 2/3) ---" && npm run test:cacheSampleProjects) || \
(echo "--- test:cacheSampleProjects (try 3/3) ---" && npm run test:cacheSampleProjects)
- run: npm run test --ignore-scripts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GL_TOKEN: ${{ secrets.GL_TOKEN }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
- name: Test Summary
uses: test-summary/action@v2.4
with:
paths: |
junit.xml
show: 'fail, skip'
if: always()
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
disable_search: true
files: ./lcov.txt
use_oidc: true
- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
disable_search: true
files: ./junit.xml
report_type: test_results
use_oidc: true