-
Notifications
You must be signed in to change notification settings - Fork 186
126 lines (100 loc) · 3.46 KB
/
Copy pathci.yml
File metadata and controls
126 lines (100 loc) · 3.46 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
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
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# 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@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: true
version: "0.11.31"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --frozen --dev --python ${{ matrix.python-version }}
- name: Lint with ruff
run: uv run --frozen ruff check phy
- name: Check formatting with ruff
run: uv run --frozen ruff format --check phy
# phy currently relies on SpikeSelector changes newer than phylib 2.7.0.
# Keep normal CI reproducible until those changes are included in a release.
- name: Install tested phylib revision
run: uv pip install --python .venv "phylib @ git+https://github.com/cortex-lab/phylib.git@db10401589b47fd8d56f7c66531b0c22fc7f9e91"
- name: Test with pytest
run: uv run --no-sync 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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: true
version: "0.11.31"
- name: Set up Python
run: uv python install 3.10
- name: Build package
run: uv build --no-sources
- name: Test wheel installation
run: |
uv venv --python 3.10 .venv-package
uv pip install --python .venv-package/bin/python dist/*.whl
.venv-package/bin/python -c "import phy; from phy.apps import phycli"
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist/
if-no-files-found: error
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: true
version: "0.11.31"
- name: Set up Python
run: uv python install 3.10
- name: Install dependencies
run: uv sync --frozen --dev --python 3.10
- name: Generate and validate documentation
run: make doc-check