Skip to content

Catanatron Rust Rewrite #72

Catanatron Rust Rewrite

Catanatron Rust Rewrite #72

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master, staging]
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the UI Docker image
run: docker build ui/ -t bcollazo/catanatron-react-ui:latest
- name: Build the Server Docker image
run: docker build . -f Dockerfile.web -t bcollazo/catanatron-server:latest
# - name: Build the Paperspace Docker image
# run: docker build . -f Dockerfile.paperspace -t bcollazo/paperspace-rl
build-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip" # caching pip dependencies
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -r all-requirements.txt
- name: Lint with black
run: |
black catanatron_core --check
black catanatron_gym --check
black catanatron_server --check
black catanatron_experimental --check
- name: Run sample catanatron-play
run: |
catanatron-play --players=R,W,F,AB:2 --num=2
- name: Test with pytest
run: |
coverage run --source=catanatron -m pytest tests/
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
build-gym:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip" # caching pip dependencies
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -e catanatron_core
pip install -e catanatron_gym
- name: Inline test
run: |
python -c "import gymnasium as gym; env = gym.make('catanatron_gym:catanatron-v1')"
- name: Test README.md sample (and fail even on warnings)
run: |
python -W error catanatron_gym/sample.py
build-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
working-directory: ./ui
- run: npm run build
working-directory: ./ui
build-rust:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Run `cargo fmt`
run: cargo fmt -- --check
working-directory: catanatron_rust
- name: Run `cargo clippy`
run: cargo clippy -- -D warnings
working-directory: catanatron_rust
- name: Run `cargo run`
run: cargo run
working-directory: catanatron_rust
- name: Run `cargo run --release`
run: cargo run --release
working-directory: catanatron_rust
- name: Run `cargo test`
run: cargo test --verbose
working-directory: catanatron_rust
- name: Run `cargo test --release`
run: cargo test --release --verbose
working-directory: catanatron_rust
- name: Run `cargo bench`
run: cargo bench
working-directory: catanatron_rust