-
Notifications
You must be signed in to change notification settings - Fork 8
155 lines (117 loc) · 3.88 KB
/
tests.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Tests
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
cache-dependency-path: './poetry.lock'
architecture: x64
- name: Install poetry dependencies
run: poetry install
- name: Check format/
run: |
poetry run poe format-src --check --verbose
poetry run poe format-tests --check --verbose
poetry run poe format-e2e --check --verbose
poetry run poe format-installer --check --verbose
pylint:
needs: black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
cache-dependency-path: './poetry.lock'
architecture: x64
- name: Install poetry dependencies
run: poetry install
- name: Lint src/
run: poetry run poe lint
# from xPsycHoWasPx in discord chat:
# "running macOS in none gpu accelerated mode, and that means no OpenGL,
# no OpenGL no kivy window…. if u need to use vm, you also need a dedicated
# seperate supported GPU passed through to the osx VM .."
#
# TODO: find how to install properly libs for M1/M2 Macs
# they raise exceptions that numpy and others libs
# arent compiled for arm64 (macos-14 and macos-xlarge-*)
pytest:
needs: pylint
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: windows-latest
arch: x64
- os: macos-13
arch: x64
- os: macos-14
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
if: ${{ matrix.arch != 'arm64' }}
with:
python-version: '3.12'
cache: 'poetry'
cache-dependency-path: './poetry.lock'
architecture: ${{ matrix.arch }}
- uses: actions/setup-python@v5
if: ${{ matrix.arch == 'arm64' }}
with:
python-version: '3.12'
- name: Install project and its dependencies
run: poetry install
- name: Run tests with coverage (Linux)
if: ${{ runner.os == 'Linux' }}
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
with:
run: |
poetry add pytest-xvfb
poetry run poe coverage
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
if: ${{ runner.os == 'Linux' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Run tests (MacOS)
if: ${{ runner.os == 'macOS' }}
run: poetry run poe test-unit
- name: Run tests (Windows)
if: ${{ runner.os == 'Windows' }}
env:
KIVY_GL_BACKEND: 'angle_sdl2'
run: poetry run poe test
#- name: Run tests (MacOS)
# if: ${{ runner.os == 'macOS' }}
# env:
# KIVY_GL_DEBUG: 1
# KIVY_GL_BACKEND: 'gl'
# run: poetry run poe test