-
Notifications
You must be signed in to change notification settings - Fork 70
90 lines (80 loc) · 2.67 KB
/
build.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# 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