11
name: Check the code style
12
runs-on: ubuntu-latest
14
- uses: actions/checkout@v3
15
- uses: actions/setup-python@v4
17
python-version: "3.10"
18
- uses: pre-commit/action@v3.0.0
22
runs-on: ubuntu-latest
25
python-version: ["3.8", "3.10"]
27
- uses: actions/checkout@v3
28
- name: Set up Python ${{ matrix.python-version }}
29
uses: actions/setup-python@v4
31
python-version: ${{ matrix.python-version }}
32
- name: Set up test environment
34
python -m pip install --upgrade pip
39
- name: Upload coverage data
40
uses: actions/upload-artifact@v3
44
if-no-files-found: ignore
47
name: Combine & check coverage.
49
runs-on: ubuntu-latest
52
- uses: actions/checkout@v3
56
- uses: actions/setup-python@v4
59
python-version: "3.11"
61
- name: Set up environment
63
pip install --upgrade "coverage[toml]>=5.1" diff-cover
65
- uses: actions/download-artifact@v3
69
- name: Fetch master for coverage diff
71
git fetch --no-tags --prune origin main
73
- name: Combine coverage & fail if it's <100%.
75
# Combine coverage files (not needed now, but maybe later)
76
# python -m coverage combine
79
python -m coverage html --skip-covered --skip-empty
82
python -m coverage xml
83
diff-cover coverage.xml --markdown-report=coverage.md --fail-under=100 || (cat coverage.md >> $GITHUB_STEP_SUMMARY && exit 1)
85
- name: Upload HTML report if check failed.
86
uses: actions/upload-artifact@v3