-
Notifications
You must be signed in to change notification settings - Fork 10
executable file
·102 lines (95 loc) · 2.73 KB
/
ci.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
name: CI
on:
push:
branches:
- master
- release
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
lint:
name: Lint with ruff
runs-on: arc-runners-small
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: ./.github/workflows/actions/prepare
with:
python-version: "3.11"
- name: Check files using the ruff formatter
run: |
poetry run ruff check --fix --unsafe-fixes --preview --exit-zero .
poetry run ruff format .
shell: bash
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
fetch: false
default_author: github_actions
message: 'Backend: Auto format'
add: '.'
mypy:
name: Static Type Checking
runs-on: arc-runners-small
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: "3.12"
- name: Mypy
run: poetry run mypy .
shell: bash
test:
name: Run unit test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Ubuntu
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
# Windows
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.12"
# macOS (arm64)
- os: macos-14
python-version: "3.10"
- os: macos-14
python-version: "3.11"
- os: macos-14
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: ${{ matrix.python-version }}
# Set environment variables for Windows
- name: Configure Windows environment
if: runner.os == 'Windows'
run: |
echo "PYTHONIOENCODING=utf-8" >> $GITHUB_ENV
echo "PYTHONUTF8=1" >> $GITHUB_ENV
echo "PYTHONLEGACYWINDOWSSTDIO=0" >> $GITHUB_ENV
shell: bash
- name: Run Tests
run: poetry run python tests/testing.py
shell: bash
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: 1
PYTHONLEGACYWINDOWSSTDIO: 0