fix(engine): reject invalid reversi moves #364
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: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-and-build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # Use major version tags to automatically receive patch updates | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20.19.0 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: nightly | |
| components: rustc, clippy | |
| - name: Cache cargo files | |
| id: cargo-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| engine/target/ | |
| ~/.cache/wasm-pack/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('engine/Cargo.lock') }} | |
| - name: Install wasm-pack | |
| if: steps.cargo-cache.outputs.cache-hit != 'true' | |
| run: cargo install wasm-pack | |
| - name: Test at engine/ | |
| working-directory: ./engine | |
| run: cargo test | |
| - name: Run clippy at engine/ | |
| working-directory: ./engine | |
| run: cargo clippy -- -D warnings | |
| - name: Cache wasm-pack build output | |
| id: wasm-pack-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: engine/pkg | |
| key: ${{ runner.os }}-wasm-pack-${{ hashFiles('engine/Cargo.toml', 'engine/Cargo.lock', 'engine/src/**/*.rs') }} | |
| - name: Build wasm package | |
| if: steps.wasm-pack-cache.outputs.cache-hit != 'true' | |
| working-directory: ./engine | |
| run: wasm-pack build | |
| - name: npm ci, build, and test | |
| working-directory: ./frontend | |
| run: | | |
| npm ci --ignore-scripts | |
| npm run check:format | |
| npm test | |
| npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| path: ./frontend/dist | |
| deploy: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-24.04 | |
| needs: test-and-build | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |