Skip to content

Commit 8603579

Browse files
committed
More CI Updates and linting fixes
1 parent f29eb76 commit 8603579

3 files changed

Lines changed: 198 additions & 193 deletions

File tree

.github/workflows/CI.yml

Lines changed: 63 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,63 @@
1-
on:
2-
push:
3-
branches:
4-
- development
5-
tags:
6-
- '**'
7-
pull_request: {}
8-
9-
permissions:
10-
contents: read
11-
12-
jobs:
13-
lint:
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- uses: actions/checkout@v3
18-
19-
- name: install rust stable
20-
uses: dtolnay/rust-toolchain@stable
21-
with:
22-
components: rustfmt, clippy
23-
24-
- name: cache rust
25-
uses: Swatinem/rust-cache@v2
26-
27-
- uses: actions/setup-python@v4
28-
with:
29-
python-version: '3.11'
30-
31-
- uses: actions/cache@v3
32-
id: cache-py
33-
name: cache python
34-
with:
35-
path: ${{ env.pythonLocation }}
36-
key: >
37-
py
38-
${{ env.pythonLocation }}
39-
${{ hashFiles('tests/requirements-linting.txt') }}
40-
${{ hashFiles('pyproject.toml') }}
41-
42-
- run: pip install -r tests/requirements-linting.txt
43-
if: steps.cache-py.outputs.cache-hit != 'true'
44-
45-
- run: pip install .
46-
if: steps.cache-py.outputs.cache-hit != 'true'
47-
48-
- run: pip freeze
49-
50-
- run: make lint
51-
52-
build-dev:
53-
runs-on: ubuntu-latest
54-
if: "!startsWith(github.ref, 'refs/tags/')"
55-
steps:
56-
- uses: actions/checkout@v3
57-
- uses: actions/setup-python@v4
58-
with:
59-
python-version: '3.10'
60-
- name: Build Wheel
61-
uses: PyO3/maturin-action@v1
62-
with:
63-
target: x86_64
64-
args: --release --out dist --find-interpreter
65-
manylinux: auto
66-
67-
linux:
68-
runs-on: ubuntu-latest
69-
strategy:
70-
matrix:
71-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
72-
if: "startsWith(github.ref, 'refs/tags/')"
73-
steps:
74-
- uses: actions/checkout@v3
75-
- uses: actions/setup-python@v4
76-
with:
77-
python-version: '3.10'
78-
- name: Build wheels
79-
uses: PyO3/maturin-action@v1
80-
with:
81-
target: ${{ matrix.target }}
82-
args: --release --out dist --find-interpreter
83-
sccache: 'true'
84-
manylinux: auto
85-
- name: Upload wheels
86-
uses: actions/upload-artifact@v3
87-
with:
88-
name: wheels
89-
path: dist
90-
91-
windows:
92-
runs-on: windows-latest
93-
strategy:
94-
matrix:
95-
target: [x64, x86]
96-
if: "startsWith(github.ref, 'refs/tags/')"
97-
steps:
98-
- uses: actions/checkout@v3
99-
- uses: actions/setup-python@v4
100-
with:
101-
python-version: '3.10'
102-
architecture: ${{ matrix.target }}
103-
- name: Build wheels
104-
uses: PyO3/maturin-action@v1
105-
with:
106-
target: ${{ matrix.target }}
107-
args: --release --out dist --find-interpreter
108-
sccache: 'true'
109-
- name: Upload wheels
110-
uses: actions/upload-artifact@v3
111-
with:
112-
name: wheels
113-
path: dist
114-
115-
macos:
116-
runs-on: macos-latest
117-
strategy:
118-
matrix:
119-
target: [x86_64, aarch64]
120-
if: "startsWith(github.ref, 'refs/tags/')"
121-
steps:
122-
- uses: actions/checkout@v3
123-
- uses: actions/setup-python@v4
124-
with:
125-
python-version: '3.10'
126-
- name: Build wheels
127-
uses: PyO3/maturin-action@v1
128-
with:
129-
target: ${{ matrix.target }}
130-
args: --release --out dist --find-interpreter
131-
sccache: 'true'
132-
- name: Upload wheels
133-
uses: actions/upload-artifact@v3
134-
with:
135-
name: wheels
136-
path: dist
137-
138-
sdist:
139-
runs-on: ubuntu-latest
140-
if: "startsWith(github.ref, 'refs/tags/')"
141-
steps:
142-
- uses: actions/checkout@v3
143-
- name: Build sdist
144-
uses: PyO3/maturin-action@v1
145-
with:
146-
command: sdist
147-
args: --out dist
148-
- name: Upload sdist
149-
uses: actions/upload-artifact@v3
150-
with:
151-
name: wheels
152-
path: dist
153-
154-
release:
155-
name: Release
156-
runs-on: ubuntu-latest
157-
if: "startsWith(github.ref, 'refs/tags/')"
158-
needs: [linux, windows, macos, sdist]
159-
steps:
160-
- uses: actions/download-artifact@v3
161-
with:
162-
name: wheels
163-
- name: Publish to PyPI
164-
uses: PyO3/maturin-action@v1
165-
env:
166-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
167-
with:
168-
command: upload
169-
args: --skip-existing *
1+
on:
2+
push:
3+
branches:
4+
- development
5+
pull_request: {}
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: install rust stable
18+
uses: dtolnay/rust-toolchain@stable
19+
with:
20+
components: rustfmt, clippy
21+
22+
- name: cache rust
23+
uses: Swatinem/rust-cache@v2
24+
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.11'
28+
29+
- uses: actions/cache@v3
30+
id: cache-py
31+
name: cache python
32+
with:
33+
path: ${{ env.pythonLocation }}
34+
key: >
35+
py
36+
${{ env.pythonLocation }}
37+
${{ hashFiles('tests/requirements-linting.txt') }}
38+
${{ hashFiles('pyproject.toml') }}
39+
40+
- run: pip install -r tests/requirements-linting.txt
41+
if: steps.cache-py.outputs.cache-hit != 'true'
42+
43+
- run: pip install .
44+
if: steps.cache-py.outputs.cache-hit != 'true'
45+
46+
- run: pip freeze
47+
48+
- run: make lint
49+
50+
build:
51+
runs-on: ubuntu-latest
52+
if: "!startsWith(github.ref, 'refs/tags/')"
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: actions/setup-python@v4
56+
with:
57+
python-version: '3.10'
58+
- name: Build Wheel
59+
uses: PyO3/maturin-action@v1
60+
with:
61+
target: x86_64
62+
args: --release --out dist --find-interpreter
63+
manylinux: auto

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)