name: Game

on:
  push:
    branches: [ "main" ]
    paths: [ "game/**" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    container: sfja/h5-mst-ci:game-ci
    needs: [lint, build_and_test]
    steps:
    - run: echo Done
  lint:
    name: Lint
    runs-on: ubuntu-latest
    container: sfja/h5-mst-ci:game-ci
    steps:
    - uses: actions/checkout@v6
    - run: rustup default stable
    - name: Check
      working-directory: ./game
      run: cargo check
    - name: Clippy
      working-directory: ./game
      continue-on-error: true
      run: cargo clippy
  build_and_test:
    name: Build and test
    runs-on: ubuntu-latest
    container: sfja/h5-mst-ci:game-ci
    steps:
    - uses: actions/checkout@v6
    - run: rustup default stable
    - name: Build
      working-directory: ./game
      run: cargo build
    - name: Test
      working-directory: ./game
      run: cargo test

