ci: specify target platform in build commands\n\n- Replace npm run bu… #6
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Test on Node ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [16.x, 18.x, 20.x] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Cache NPM dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: node_modules | |
| key: npm-cache-test-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test |