-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.91 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
# -----------------------------------------------------------------------------
# - invoked on push, pull_request, or manual trigger
# - tests under multiple versions of python
# - only quick tests are run here
#
# NOTE: We do not run tests marked as slow nor do we schedule runs here.
# Slow tests and scheduled runs are handled via Jenkins because that has
# access to the cluster which is required for some tests.
# -----------------------------------------------------------------------------
name: build
on: [push, pull_request, workflow_dispatch]
jobs:
get-python-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install jq
run: sudo apt-get install jq
- name: Get Python versions
id: set-matrix
run: |
echo "MATRIX_RESULT=$(jq -c . python_versions.json)" >> $GITHUB_ENV
outputs:
matrix: ${{ env.MATRIX_RESULT }}
build:
needs: get-python-versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(needs.get-python-versions.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Print environment values
run: |
python --version
cat $GITHUB_ENV
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Lint
run: |
pip install black==22.3.0 isort
black . --check --diff
isort . --check --verbose --only-modified --diff
- name: Install dependencies
run: |
pip install .[dev]
- name: Test
run: |
pytest ./tests
- name: Build Docs
run: |
make html -C docs/ SPHINXOPTS="-W --keep-going -n"