Skip to content

Commit 73d9753

Browse files
committed
CI add test and lint check for *.X branch
1 parent bd4fd12 commit 73d9753

File tree

3 files changed

+148
-87
lines changed

3 files changed

+148
-87
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,17 @@ on:
88
branches: ["main"]
99

1010
jobs:
11-
test:
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: prefix-dev/[email protected]
17-
with:
18-
environments: default
19-
cache: true
20-
21-
- name: Re-install local
22-
run: |
23-
pixi run rebuild
24-
25-
- name: Lint with ruff
26-
run: |
27-
pixi run lint
28-
- name: Lint with cython-lint
29-
run: |
30-
pixi run cython-lint
31-
- name: Format with black
32-
run: |
33-
pixi run fmt
34-
- name: Type check with mypy
35-
run: |
36-
pixi run type
37-
- name: Test with pytest
38-
run: |
39-
pixi run test
40-
- name: Test with doctest
41-
shell: bash
42-
run: |
43-
pixi run doc
44-
CMD=doctest pixi run doc
45-
- name: Test coverage
46-
shell: bash
47-
run: |
48-
FMT=xml pixi run test-coverage
49-
- name: Upload coverage reports to Codecov
50-
uses: codecov/codecov-action@v5
51-
with:
52-
token: ${{ secrets.CODECOV_TOKEN }}
53-
- name: Build SDist
54-
run: |
55-
pixi run build-sdist
56-
- name: Store artifacts
57-
uses: actions/upload-artifact@v4
58-
with:
59-
name: cibw-sdist
60-
path: dist/*.tar.gz
11+
call-test:
12+
uses: ./.github/workflows/test.yml
13+
secrets: inherit
6114

6215
build:
6316
strategy:
6417
fail-fast: false
6518
matrix:
6619
os: [ubuntu-latest, windows-latest, macos-latest]
6720
runs-on: ${{ matrix.os }}
68-
needs: test
21+
needs: call-test
6922
steps:
7023
- uses: actions/checkout@v4
7124
- name: Build wheels

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches: [ "main", "*.X" ]
7+
pull_request:
8+
branches: [ "main", "*.X" ]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: prefix-dev/[email protected]
17+
with:
18+
environments: default
19+
cache: true
20+
21+
- name: Re-install local
22+
run: |
23+
pixi run rebuild
24+
25+
- name: Lint with ruff
26+
run: |
27+
pixi run lint
28+
- name: Lint with cython-lint
29+
run: |
30+
pixi run cython-lint
31+
- name: Format with black
32+
run: |
33+
pixi run fmt
34+
- name: Type check with mypy
35+
run: |
36+
pixi run type
37+
- name: Test with pytest
38+
run: |
39+
pixi run test
40+
- name: Test with doctest
41+
shell: bash
42+
run: |
43+
pixi run doc
44+
CMD=doctest pixi run doc
45+
- name: Test coverage
46+
shell: bash
47+
run: |
48+
FMT=xml pixi run test-coverage
49+
- name: Upload coverage reports to Codecov
50+
uses: codecov/codecov-action@v5
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
- name: Build SDist
54+
run: |
55+
pixi run build-sdist
56+
- name: Store artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: cibw-sdist
60+
path: dist/*.tar.gz

pixi.lock

Lines changed: 84 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)