{fix} properly fail builder if tests fail #96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
name: "Validation" | |
jobs: | |
code-style: | |
name: "Code Style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: yarn | |
- name: Install | |
shell: bash | |
run: | | |
yarn install --immutable | |
- name: 'Check for formatting errors (fix w/ "yarn prettier --write path/to/file")' | |
run: | | |
yarn prettier --check . | |
shell: bash | |
- name: 'Check for linting errors (fix w/ "yarn lint -c fix")' | |
run: | | |
yarn sn lint | |
shell: bash | |
build-unit: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: yarn | |
- name: Install | |
shell: bash | |
run: | | |
yarn install --immutable | |
- name: Build | |
shell: bash | |
run: | | |
yarn sn build | |
integration: | |
name: "Run via ${{matrix.cli}} in node.js ${{matrix.node}} on ${{matrix.os}}" | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
node: | |
- 18.x | |
- 20.x | |
cli: | |
- sn | |
include: | |
# Verify that everything works if using the @angular/cli | |
- os: ubuntu-latest | |
node: 18.x | |
cli: ng | |
# Test future node version(s) | |
- os: ubuntu-latest | |
node: 22.x | |
cli: sn | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Use Node.js ${{matrix.node}}" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{matrix.node}} | |
cache: yarn | |
- name: Install | |
shell: bash | |
run: | | |
yarn install --immutable | |
- name: "Run tests" | |
shell: bash | |
run: | | |
yarn ${{matrix.cli}} test integration | |
- name: "Run tests in production" | |
shell: bash | |
run: | | |
yarn ${{matrix.cli}} test integration --configuration production | |
- name: "Failing tests" | |
shell: bash | |
run: | | |
set +e | |
yarn ${{matrix.cli}} test integration --configuration failing | |
if [ $? -eq 0 ]; then | |
echo "Expected command to fail" | |
exit 1 | |
fi |