Build and Test packages-v1 #20
This file contains hidden or 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 packages-v1 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages-v1/**' | |
| - 'package.json' | |
| - '.github/workflows/build-packages-v1.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages-v1/**' | |
| - 'package.json' | |
| - '.github/workflows/build-packages-v1.yml' | |
| schedule: | |
| - cron: '0 0 * * 0' # Run weekly on Sundays at midnight UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22, 24] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build packages-v1 | |
| run: npm run build | |
| build-summary: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: always() | |
| steps: | |
| - name: Check build status | |
| run: | | |
| if [ "${{ needs.build.result }}" != "success" ]; then | |
| echo "Build failed for one or more Node.js versions" | |
| exit 1 | |
| fi | |
| echo "All builds passed successfully" |