mirror of
https://github.com/SonarSource/sonarqube-scan-action.git
synced 2026-05-23 02:15:55 +00:00
Co-authored-by: sonar-review-alpha[bot] <266116024+sonar-review-alpha[bot]@users.noreply.github.com>
40 lines
865 B
YAML
40 lines
865 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 status --porcelain)" ]; then
|
|
echo "::error::dist/ is out of date. Run 'npm run build' and commit the changes."
|
|
git status --short
|
|
exit 1
|
|
fi
|
|
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
|