Skip to content

Commit 44fb7fe

Browse files
peng.li24claude
andcommitted
ci: auto-build .deb and run tests on push/tag/PR
- test job: compile module + run 336 precision tests - release job (on tag v*): build .deb, publish release with asset Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6211223 commit 44fb7fe

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
# ---- Test: build module + run 336 precision tests --------------------------
12+
test:
13+
runs-on: ubuntu-20.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y python3 python3-pip python3-dev libeigen3-dev
21+
pip3 install pybind11 numpy pytest
22+
23+
- name: Build test module
24+
working-directory: tests
25+
run: make
26+
27+
- name: Run tests
28+
run: PYTHONPATH=tests:$PYTHONPATH python3 -m pytest tests/ -v
29+
30+
# ---- Release: build .deb and publish on tag -------------------------------
31+
release:
32+
if: startsWith(github.ref, 'refs/tags/v')
33+
needs: test
34+
runs-on: ubuntu-20.04
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Build .deb
39+
run: |
40+
mkdir build && cd build
41+
cmake .. -DCMAKE_BUILD_TYPE=Release
42+
make deb
43+
44+
- name: Publish release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
files: build/numpycpp-dev-*.deb
48+
generate_release_notes: true
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)