mirror of
https://github.com/SonarSource/sonarqube-scan-action.git
synced 2026-05-22 18:05:57 +00:00
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>
36 lines
706 B
YAML
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
|