-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (90 loc) · 3.42 KB
/
main.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
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
name: Main
on:
- push
- pull_request
jobs:
test:
strategy:
fail-fast: true
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04', 'macos-13', 'macos-14', 'macos-15', 'windows-2019', 'windows-2022']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python Dependencies
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-os:${{ matrix.os }}-python:${{ matrix.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
- name: Install Dependencies
shell: bash
run: pip3 install -r requirements.txt -r requirements-dev.txt
- name: Check Python Version Compatibility
shell: bash
run: vermin --no-tips --no-parse-comments --exclude ast.unparse --target=3.8- --violations autograder
- name: Run Tests
shell: bash
run: ./run_tests.py
- name: Check Style
shell: bash
run: ./.ci/check_style.sh
verify-test-data:
needs: test
strategy:
matrix:
python-version: ['3.11']
os: ['ubuntu-22.04']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python Dependencies
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-os:${{ matrix.os }}-python:${{ matrix.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
- name: Install Dependencies
shell: bash
run: pip3 install -r requirements.txt -r requirements-dev.txt
- name: Verify Test Data
shell: bash
run: ./.ci/verify_test_api_requests.py --docker
deploy:
needs: verify-test-data
strategy:
matrix:
python-version: ['3.11']
os: ['ubuntu-22.04']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python Dependencies
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-os:${{ matrix.os }}-python:${{ matrix.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}
- name: Install Python Dependencies
shell: bash
run: pip3 install -r requirements.txt -r requirements-dev.txt
- name: Deploy
uses: casperdcl/deploy-pypi@10cf4cd83fc885003a8d4f37f93a5a0f0fc2d2f4 # v2.4.1
with:
build: --sdist --wheel --outdir dist .
# Only upload if a tag is pushed (otherwise just build & check).
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
password: ${{ secrets.PYPI_TOKEN }}