Configure Azure Developer Pipeline #1
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
name: Build and test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build_test: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
node-version: ['20'] | |
name: ${{ matrix.platform }} / Node.js v${{ matrix.node-version }} | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- run: git config --global core.autocrlf false | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm cache verify && npm ci | |
- name: Build packages | |
run: npm run build | |
- name: Test packages | |
run: npm test --if-present || exit 0 | |
build_test_all: | |
if: always() | |
runs-on: ubuntu-latest | |
needs: build_test | |
steps: | |
- name: Check build matrix status | |
if: ${{ needs.build_test.result != 'success' }} | |
run: exit 1 |