-
Notifications
You must be signed in to change notification settings - Fork 446
93 lines (92 loc) · 3.17 KB
/
tox.yaml
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
name: Tox
on:
push:
branches:
- "main"
- "snapcraft/7.0"
- "release/*"
- "hotfix/*"
pull_request:
jobs:
linters:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
echo "::group::Begin snap install"
echo "Installing snaps in the background while running apt and pip..."
sudo snap install --no-wait --classic pyright
sudo snap install --no-wait shellcheck
echo "::endgroup::"
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::apt-get install..."
sudo apt-get install --yes libapt-pkg-dev libyaml-dev xdelta3
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
echo "::endgroup::"
echo "::group::Create virtual environments for linting processes."
tox run -m lint --notest
echo "::endgroup::"
echo "::group::Wait for snap to complete"
snap watch --last=install
echo "::endgroup::"
- name: Run Linters
run: tox run --skip-pkg-install -m lint
tests:
strategy:
fail-fast: false # Run all the tests to their conclusions.
matrix:
platform: [ubuntu-20.04, ubuntu-22.04]
python_version: ["3.8", "3.10"]
include:
- python_version: "3.8"
tox_python: py38
- python_version: "3.10"
tox_python: py310
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python version ${{ matrix.python_version }} on ${{ matrix.platform }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::apt-get install..."
sudo apt-get install -y libapt-pkg-dev libyaml-dev xdelta3
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
echo "::endgroup::"
mkdir -p results
- name: Setup Tox environments
run: tox run-parallel --parallel auto --parallel-no-spinner --parallel-live -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }} --notest
- name: Test with tox
run: tox run --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }}
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
directory: ./results/
files: coverage*.xml
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.platform }}
path: results/