Skip to content

Cleanup

Cleanup #727

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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
paths:
- 'deep_quoridor/src/**'
- 'deep_quoridor/test/**'
- 'deep_quoridor/experiments/**'
- 'deep_quoridor/*requirements.txt'
- '.github/workflows/python-app.yml'
pull_request:
paths:
- 'deep_quoridor/src/**'
- 'deep_quoridor/test/**'
- 'deep_quoridor/experiments/**'
- 'deep_quoridor/*requirements.txt'
- '.github/workflows/python-app.yml'
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Debug with SSH
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f deep_quoridor/requirements.txt ]; then pip install -r deep_quoridor/ci_requirements.txt; fi
- name: Test with pytest
run: |
PYTHONPATH=$PYTHONPATH:$(pwd)/deep_quoridor/src pytest deep_quoridor/test
- name: Run some games as a sanity check
run: |
PYTHONPATH=$PYTHONPATH:$(pwd)/deep_quoridor/src python deep_quoridor/src/play.py -p greedy mcts -t 2
- name: Train v2 sanity check
run: |
PYTHONPATH=$PYTHONPATH:$(pwd)/deep_quoridor/src python deep_quoridor/src/train_v2.py deep_quoridor/experiments/ci.yaml