-
-
Notifications
You must be signed in to change notification settings - Fork 74
91 lines (79 loc) · 2.5 KB
/
python-lint-tests.yml
File metadata and controls
91 lines (79 loc) · 2.5 KB
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
name: CI
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
- release/*
jobs:
# ----------------------------------------
lint-tests:
strategy:
fail-fast: true
matrix:
python-version: ['3.11', '3.11', '3.13']
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Just
uses: extractions/setup-just@v2
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pipx install --python ${{ matrix.python-version }} poetry!=1.4.1
# TODO: cache poetry venv
- name: Install project
run: |
python --version
poetry config virtualenvs.in-project true
poetry env use ${{ matrix.python-version }}
poetry install -E all --with docs,dev
- name: Lint and static analysis
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' # no need to run that 9x
run: |
poetry run just lint
# needed for tests to work on ubuntu (libEGL.so.1)
- name: Install EGL mesa
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1-mesa-dev
# PYTEST STRATEGY
# macOS is the only runner who has working ModernGL behaviour
# macOS + 3.11 is used for code coverage
- name: Pytest (code coverage)
run: |
poetry run pytest --cov=./ --cov-report=xml
if: matrix.os == 'macos-latest' && matrix.python-version == '3.12'
- name: Pytest
run: |
poetry run pytest
if: matrix.os == 'macos-latest' && matrix.python-version != '3.12'
- name: Pytest (no image similarity check)
run: |
poetry run pytest --skip-image-similarity
if: matrix.os != 'macos-latest'
- name: Upload comparison test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test_report_${{ runner.os }}_${{ matrix.python-version }}
path: |
test_report_img_sim/**/*
test_report_reference_svg/**/*
if-no-files-found: ignore
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
if: matrix.os == 'macos-latest' && matrix.python-version == '3.12'