-
Notifications
You must be signed in to change notification settings - Fork 367
73 lines (73 loc) · 2.14 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
name: build
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install flake8
run: pip install flake8 flake8-import-order flake8-future-import flake8-commas flake8-logging-format flake8-quotes
- name: Lint with flake8
run: |
flake8 --version
flake8
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install mypy dependencies
run: |
pip install mypy
pip install -r requirements.txt
pip install -r requirements-mypy.txt
pip install mysqlclient
cp .ci.settings.py dmoj/local_settings.py
- name: Run typecheck with mypy
run: |
PYTHONPATH=. mypy judge
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('requirements.txt') }}
- name: Install unit test dependencies
run: |
pip install wheel
pip install -r requirements.txt
pip install mysqlclient coverage
cp .ci.settings.py dmoj/local_settings.py
- name: Start MySQL
run: sudo systemctl start mysql.service
- name: Run unit tests
run: coverage run --source=. manage.py test judge
- name: Generate coverage report
run: coverage xml
- uses: codecov/codecov-action@v1
styles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install npm packages
run: npm install -g sass postcss-cli postcss autoprefixer
- name: Build style.css
run: ./make_style.sh