CI #93
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: CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: {} | |
| schedule: | |
| - cron: '0 2 * * *' # nightly at 02:00 UTC | |
| jobs: | |
| test-quick: | |
| name: Quick tests (Perft --quick) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [14.x, 16.x, 18.x, 20.x] | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.npm | |
| ~/.cache | |
| node_modules | |
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| - name: Ensure npm cache dirs exist | |
| run: | | |
| mkdir -p ~/.npm | |
| mkdir -p ~/.cache | |
| echo "Created npm cache dirs" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run quick Perft tests | |
| run: npm test | |
| test-bitboard-full: | |
| name: Full Bitboard tests (manual) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' | |
| needs: test-quick | |
| strategy: | |
| matrix: | |
| node-version: [16.x] | |
| timeout-minutes: 360 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run full Bitboard tests | |
| run: npm run test:bb |