sonarqube-scan-action/.github/workflows/unit-tests.yml
Jarek Potiuk dd2390abf0
Add build and dist/ freshness check to CI
The CI workflow only ran tests without rebuilding dist/, so dependency
updates (e.g. from Dependabot) would be merged with stale compiled JS
built from the previous toolchain. Now CI rebuilds and fails if dist/
is out of date.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 17:56:12 +03:00

36 lines
706 B
YAML

name: Unit tests
on:
push:
branches: [master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Check dist/ is up-to-date
run: |
if [ -n "$(git diff --name-only)" ]; then
echo "::error::dist/ is out of date. Run 'npm run build' and commit the changes."
git diff --name-only
exit 1
fi
- name: Run tests
run: npm test