-
Notifications
You must be signed in to change notification settings - Fork 15
81 lines (65 loc) · 2.03 KB
/
build-test.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
name: Build and Test
# Run this workflow whenever a PR is created or pushed to.
on:
pull_request:
types: [opened, synchronize]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: False
steps:
- name: Checkout code
uses: actions/checkout@v3
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
- name: Unshallow checkout
run: git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
docker version
sudo apt-get update
sudo apt-get install -y musl-tools
ci/test_setup.sh
- name: Lint
run: |
mypy
- name: Build
run: |
python -m build
- name: Run tests
run: |
# Make sure we only use the wheel
rm -r scuba scubainit
pip install dist/scuba-*-py3-none-any.whl
./run_unit_tests.sh
./run_full_tests.py
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Unit Test Results (Python ${{ matrix.python-version }})
path: unit-test-results.xml
# https://github.com/marketplace/actions/publish-unit-test-results#use-with-matrix-strategy
publish-test-results:
name: "Publish Unit Tests Results"
needs: build-and-test
runs-on: ubuntu-latest
# the build-and-test job might be skipped, we don't need to run this job then
if: success() || failure()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml