-
Notifications
You must be signed in to change notification settings - Fork 187
101 lines (81 loc) · 2.35 KB
/
Copy pathci.yml
File metadata and controls
101 lines (81 loc) · 2.35 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
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
# Set up display for GUI testing on Linux
- name: Set up display (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb herbstluftwm
export DISPLAY=:99.0
Xvfb :99 -screen 0 1400x900x24 -ac +extension GLX +render &
sleep 3
herbstluftwm &
sleep 1
env:
DISPLAY: :99.0
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --dev
- name: Install phylib from branch
if: github.ref_name == 'master' || github.ref_name == 'dev'
run: uv add "git+https://github.com/cortex-lab/phylib.git@${{ github.ref_name }}"
- name: Install additional test dependencies
run: |
uv add "git+https://github.com/kwikteam/klusta.git"
uv add --no-build-isolation "git+https://github.com/kwikteam/klustakwik2.git"
- name: Lint with ruff
run: uv run ruff check phy
- name: Check formatting with ruff
run: uv run ruff format --check phy
- name: Test with pytest
run: uv run pytest --cov=phy --cov-report=xml phy
env:
DISPLAY: ${{ runner.os == 'Linux' && ':99.0' || '' }}
QT_QPA_PLATFORM: offscreen
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python
run: uv python install 3.10
- name: Build package
run: uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/