-
Notifications
You must be signed in to change notification settings - Fork 27
89 lines (72 loc) · 2.29 KB
/
python-actions.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
name: Python actions
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
run_linter_and_unit_tests:
name: Run linter and unit tests
runs-on: ${{ matrix.os }}
strategy:
# Run all steps regardless of failures
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.11]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements.dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors
echo Running flake8. error/warning count ...
flake8 .
- name: Test with pytest
run: |
pytest
run_test_bots:
name: Run test bots
# for this purpose, test games can only be run with the headless Sc2 Linux client.
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: true # one failure is enough
matrix:
python-version: [3.11]
player1: [bio, bc, 4gate, lurker, mutalisk, saferaven, disruptor]
player2: [ai.zerg.hard.macro]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Print directories and files
run: |
sudo apt-get install tree
tree
- name: Load and build docker image
run: |
docker build -t test_image -f test/Dockerfile_python-sc2 .
- name: Run bots
run: |
docker run --interactive --tty --detach --name app1 test_image
docker exec -i app1 bash -c "tree"
# travis_test_script.py is a wrapper for SC2 bots to set a timeout
# docker exec --interactive app1 bash -c "python python-sc2/test/travis_test_script.py"
# could use matrix here to provide the bots and map
docker exec -i app1 bash -c "python run_custom.py -p1 ${{ matrix.player1 }} -p2 ${{ matrix.player2 }} --map AcolyteLE --requirewin 1"
docker rm -f app1