-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (52 loc) · 1.98 KB
/
python-app.yml
File metadata and controls
57 lines (52 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 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