Merge pull request #3 from byrdsandbytes/feature/build-workflow #4
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 | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '*.md' | |
| - 'docs/**' | |
| pull_request: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '*.md' | |
| - 'docs/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linting | |
| run: npm run lint --if-present | |
| - name: Run tests | |
| run: npm test --if-present | |
| - name: Build project | |
| run: npm run build | |
| - name: Check TypeScript compilation | |
| run: npx tsc --noEmit | |
| - name: Upload build artifacts | |
| if: matrix.node-version == '22.x' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-files | |
| path: dist/ | |
| retention-days: 30 |