-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (90 loc) · 2.64 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
103
104
105
106
107
108
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
linters:
runs-on: windows-latest
name: Lint ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev
- name: Run ruff format
run: uv run ruff format . --config .\pyproject.toml
- name: Run ruff check
run: uv run ruff check . --config .\pyproject.toml
- name: Run codespell
run : uv run codespell .
setup-bonsai:
runs-on: windows-latest
name: Setup Bonsai
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: 8.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Setup Bonsai
working-directory: bonsai
run: .\Setup.ps1
- name: Upload Bonsai Files
uses: actions/upload-artifact@v3
with:
name: bonsai-environment
path: bonsai
tests:
runs-on: windows-latest
name: Testing ${{ matrix.python-version }}
needs: setup-bonsai
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: 8.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Download Bonsai artifact
uses: actions/download-artifact@v3
with:
name: bonsai-environment
path: bonsai-environment
- name: Remove and Move Bonsai Files
run: |
Remove-Item -Recurse -Force bonsai\*
move bonsai-environment\* bonsai
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev
- name: Run tests
run: uv run -m unittest
- name: Regenerate schemas
run: uv run regenerate
- name: Check for uncommitted changes
run: |
git config --global core.safecrlf false
git diff --exit-code || (echo "Untracked changes found" && exit 1)