Skip to content

Commit 9406818

Browse files
committed
ci: split ci and build workflow
1 parent ff440d7 commit 9406818

File tree

2 files changed

+159
-134
lines changed

2 files changed

+159
-134
lines changed

.github/workflows/CI.yml

Lines changed: 33 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: ci
22
on:
33
push:
44
branches:
@@ -13,150 +13,49 @@ permissions:
1313

1414
jobs:
1515
quality:
16-
name: Quality
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/checkout@v3
20-
21-
- uses: actions/setup-python@v4
22-
with:
23-
python-version: '3.10'
24-
25-
- name: Setup python environment
26-
run: |
27-
python -m venv .venv
28-
source .venv/bin/activate
29-
python -m pip install pre-commit
30-
python -m pip install -r requirements-dev.txt
31-
32-
- name: Check quality
33-
run: |
34-
source .venv/bin/activate
35-
make lint
36-
37-
- name: Check tests
38-
run: |
39-
source .venv/bin/activate
40-
make dev
41-
make test
42-
43-
linux:
44-
name: Build linux
45-
runs-on: ubuntu-latest
46-
needs: [quality]
16+
name: ${{ matrix.os }} / ${{ matrix.python-version }}
17+
runs-on: ${{ matrix.os }}-latest
4718
strategy:
19+
fail-fast: false
4820
matrix:
49-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
50-
51-
steps:
52-
- uses: actions/checkout@v3
53-
54-
- uses: actions/setup-python@v4
55-
with:
56-
python-version: '3.10'
57-
58-
- name: Build wheels
59-
uses: PyO3/maturin-action@v1
60-
with:
61-
target: ${{ matrix.target }}
62-
args: --release --out dist --find-interpreter
63-
sccache: 'true'
64-
manylinux: auto
65-
66-
- name: Upload wheels
67-
uses: actions/upload-artifact@v3
68-
with:
69-
name: wheels
70-
path: dist
71-
72-
windows:
73-
name: Build windows
74-
runs-on: windows-latest
75-
needs: [quality]
76-
strategy:
77-
matrix:
78-
target: [x64, x86]
79-
steps:
80-
- uses: actions/checkout@v3
81-
82-
- uses: actions/setup-python@v4
83-
with:
84-
python-version: '3.10'
85-
architecture: ${{ matrix.target }}
21+
os: ["ubuntu", "macos", "windows"]
22+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
23+
defaults:
24+
run:
25+
shell: bash
8626

87-
- name: Build wheels
88-
uses: PyO3/maturin-action@v1
89-
with:
90-
target: ${{ matrix.target }}
91-
args: --release --out dist --find-interpreter
92-
sccache: 'true'
93-
94-
- name: Upload wheels
95-
uses: actions/upload-artifact@v3
96-
with:
97-
name: wheels
98-
path: dist
99-
100-
macos:
101-
name: Build macos
102-
runs-on: macos-latest
103-
needs: [quality]
104-
strategy:
105-
matrix:
106-
target: [x86_64, aarch64]
10727
steps:
10828
- uses: actions/checkout@v3
10929

110-
- uses: actions/setup-python@v4
111-
with:
112-
python-version: '3.10'
113-
114-
- name: Build wheels
115-
uses: PyO3/maturin-action@v1
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
11632
with:
117-
target: ${{ matrix.target }}
118-
args: --release --out dist --find-interpreter
119-
sccache: 'true'
33+
python-version: ${{ matrix.python-version }}
12034

121-
- name: Upload wheels
122-
uses: actions/upload-artifact@v3
123-
with:
124-
name: wheels
125-
path: dist
35+
- name: Set up python environment
36+
run: |
37+
python -m pip install pipenv
38+
python -m pipenv install -r requirements-dev.txt
12639
127-
sdist:
128-
name: Build sdist
129-
runs-on: ubuntu-latest
130-
needs: [quality]
131-
steps:
132-
- uses: actions/checkout@v3
40+
- name: Lint
41+
run: |
42+
python -m pipenv run pre-commit run --all-files
13343
134-
- name: Build sdist
44+
- name: Build
13545
uses: PyO3/maturin-action@v1
13646
with:
137-
command: sdist
138-
args: --out dist
139-
140-
- name: Upload sdist
141-
uses: actions/upload-artifact@v3
142-
with:
143-
name: wheels
144-
path: dist
47+
command: develop
14548

146-
release:
147-
name: Release
148-
runs-on: ubuntu-latest
149-
if: "startsWith(github.ref, 'refs/tags/')"
150-
needs: [linux, windows, macos, sdist]
151-
steps:
152-
- uses: actions/download-artifact@v3
153-
with:
154-
name: wheels
49+
- name: Install cargo-llvm-cov
50+
uses: taiki-e/install-action@cargo-llvm-cov
15551

156-
- name: Publish to PyPI
157-
uses: PyO3/maturin-action@v1
158-
env:
159-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
160-
with:
161-
command: upload
162-
args: --non-interactive --skip-existing *
52+
- name: Test with coverage
53+
run: |
54+
cargo llvm-cov --lcov --output-path coverage.lcov
55+
python -m pipenv run pytest --cov=bionic_writer --cov-report xml
56+
57+
- name: Publish Coverage
58+
uses: codecov/codecov-action@v1
59+
if: |
60+
matrix.os == 'ubuntu-latest' &&
61+
matrix.python-version == '3.10'

.github/workflows/build.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: build
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
linux:
12+
name: Build linux
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Build wheels
26+
uses: PyO3/maturin-action@v1
27+
with:
28+
target: ${{ matrix.target }}
29+
args: --release --out dist --find-interpreter
30+
sccache: 'true'
31+
manylinux: auto
32+
33+
- name: Upload wheels
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: wheels
37+
path: dist
38+
39+
windows:
40+
name: Build windows
41+
runs-on: windows-latest
42+
strategy:
43+
matrix:
44+
target: [x64, x86]
45+
steps:
46+
- uses: actions/checkout@v3
47+
48+
- uses: actions/setup-python@v4
49+
with:
50+
python-version: '3.10'
51+
architecture: ${{ matrix.target }}
52+
53+
- name: Build wheels
54+
uses: PyO3/maturin-action@v1
55+
with:
56+
target: ${{ matrix.target }}
57+
args: --release --out dist --find-interpreter
58+
sccache: 'true'
59+
60+
- name: Upload wheels
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: wheels
64+
path: dist
65+
66+
macos:
67+
name: Build macos
68+
runs-on: macos-latest
69+
strategy:
70+
matrix:
71+
target: [x86_64, aarch64]
72+
steps:
73+
- uses: actions/checkout@v3
74+
75+
- uses: actions/setup-python@v4
76+
with:
77+
python-version: '3.10'
78+
79+
- name: Build wheels
80+
uses: PyO3/maturin-action@v1
81+
with:
82+
target: ${{ matrix.target }}
83+
args: --release --out dist --find-interpreter
84+
sccache: 'true'
85+
86+
- name: Upload wheels
87+
uses: actions/upload-artifact@v3
88+
with:
89+
name: wheels
90+
path: dist
91+
92+
sdist:
93+
name: Build sdist
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v3
97+
98+
- name: Build sdist
99+
uses: PyO3/maturin-action@v1
100+
with:
101+
command: sdist
102+
args: --out dist
103+
104+
- name: Upload sdist
105+
uses: actions/upload-artifact@v3
106+
with:
107+
name: wheels
108+
path: dist
109+
110+
release:
111+
name: Release
112+
runs-on: ubuntu-latest
113+
if: "startsWith(github.ref, 'refs/tags/')"
114+
needs: [linux, windows, macos, sdist]
115+
steps:
116+
- uses: actions/download-artifact@v3
117+
with:
118+
name: wheels
119+
120+
- name: Publish to PyPI
121+
uses: PyO3/maturin-action@v1
122+
env:
123+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
124+
with:
125+
command: upload
126+
args: --non-interactive --skip-existing *

0 commit comments

Comments
 (0)