-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (129 loc) · 3.89 KB
/
Copy pathpython.yml
File metadata and controls
152 lines (129 loc) · 3.89 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Python
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup python3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ubuntu-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
ubuntu-pip-
ubuntu-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: flake8
test:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup python3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ubuntu-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
ubuntu-pip-
ubuntu-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Compile and set up the perfect player
run: |
cd exact-solver/
make
cd ..
ln -s exact-solver/c4solver perfect-player
ln -s extra/7x6.book ./
- name: PyTest
run: coverage run -m pytest test/
- name: Generate coverage report
run: coverage html -i
- name: Archive HTML coverage results
uses: actions/upload-artifact@v2
with:
name: coverage-html-report
path: coverage_html_report/
doc:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup python3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ubuntu-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
ubuntu-pip-
ubuntu-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build the doc
run: |
cd doc
mv deploy-conf.py conf.py
make html
- name: Archive HTML documentation
uses: actions/upload-artifact@v2
with:
name: documentation-html
path: doc/_build/html/
update-gh-pages-python:
needs: [test, lint, doc]
runs-on: ubuntu-latest
steps:
- name: Download coverage artifact
uses: actions/download-artifact@v2
with:
name: coverage-html-report
path: coverage-html-report
- name: Download documentation artifact
uses: actions/download-artifact@v2
with:
name: documentation-html
path: documentation-html
- name: Clone gh-pages repo and commit new files
run: |
git clone https://github.com/arn4/connect4.git --branch gh-pages --single-branch gh-pages
cp -r coverage-html-report gh-pages/coverage/
cp -r documentation-html gh-pages/doc/
cd gh-pages
git config --local user.email "workflows@arn4.github.io"
git config --local user.name "Python Workflow"
git add .
git commit -m "Update documentation and coverage" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.TOKEN }}