Files
reusable-workflows/.github/workflows/basic-validation.yml
T
dependabot[bot] 3114dc8cb4 Bump actions/checkout from 4 to 5 (#21)
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 21:56:04 -05:00

68 lines
2.0 KiB
YAML

# This workflow helps ensure that the code of the action we're going to deploy:
# 1. Is well-formated
# 2. Is linted
# 3. Successfully builds
# 4. Passes unit-tests
# Additionally node packages used by the action can be audited.
name: Basic validation
on:
workflow_call:
inputs:
operating-systems:
description: "Optional input to set a list of operating systems which the workflow uses. Defaults to ['ubuntu-latest', 'windows-latest', 'macos-latest'] if not set"
required: false
type: string
default: "['ubuntu-latest', 'windows-latest', 'macos-latest']"
enable-audit:
description: "Optional input to enable npm package audit process"
required: false
type: boolean
default: true
node-version:
description: "Optional input to set the version of Node.js used to build the project. The input syntax corresponds to the setup-node's one"
required: false
type: string
default: "20.x"
node-caching:
description: "Optional input to set up caching for the setup-node action. The input syntax corresponds to the setup-node's one. Set to an empty string if caching isn't needed"
required: false
type: string
default: "npm"
jobs:
build:
runs-on: ${{matrix.operating-systems}}
strategy:
fail-fast: false
matrix:
operating-systems: ${{fromJson(inputs.operating-systems)}}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js ${{inputs.node-version}}
uses: actions/setup-node@v4
with:
node-version: ${{inputs.node-version}}
cache: ${{inputs.node-caching}}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run prettier
run: npm run format-check
- name: Run linter
run: npm run lint
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Audit packages
run: npm audit --audit-level=high
if: ${{inputs.enable-audit}}