Files
actions-hugo/.github/workflows/test.yml
T
peaceiris 9b7aa41d20 ci: harden GitHub Actions workflows
Pin workflow actions to commit SHAs, set explicit permissions and timeouts, update Ubuntu runners, and include the generated action bundle.

Co-Authored-By: Codex <noreply@openai.com>
2026-05-10 01:18:21 +09:00

58 lines
1.2 KiB
YAML

name: 'Test'
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-24.04'
- 'macos-latest'
- 'windows-latest'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- name: Run prettier
if: matrix.os == 'ubuntu-24.04'
run: npm run format:check
- name: Run eslint
if: matrix.os == 'ubuntu-24.04'
run: npm run lint
- name: Run ncc
if: matrix.os == 'ubuntu-24.04'
run: npm run build
- run: npm test
- name: Upload test coverage as artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-${{ matrix.os }}
path: coverage
- uses: codecov/codecov-action@aa56896cf108bd10b5eb883cd1d24196da57f695 # v5.5.4