@@ -16,7 +16,87 @@ permissions:
1616 contents : read
1717
1818jobs :
19+ fmt :
20+ name : Format
21+ strategy :
22+ matrix :
23+ platform :
24+ - runner : ubuntu-latest
25+ target : x86_64
26+ toolchain : [stable]
27+ features : [cjk]
28+ runs-on : ${{ matrix.platform.runner }}
29+ steps :
30+ - name : Run checkout
31+ uses : actions/checkout@v4
32+
33+ - name : Install toolchain
34+ uses : dtolnay/rust-toolchain@v1
35+ with :
36+ toolchain : ${{ matrix.toolchain }}
37+ components : rustfmt, clippy
38+
39+ - name : Check format
40+ run : cargo fmt --all -- --check
41+
42+ check :
43+ name : Check
44+ needs : [fmt]
45+ strategy :
46+ matrix :
47+ platform :
48+ - runner : ubuntu-latest
49+ target : x86_64
50+ toolchain : [stable]
51+ features : [cjk]
52+ runs-on : ${{ matrix.platform.runner }}
53+ steps :
54+ - name : Run checkout
55+ uses : actions/checkout@v4
56+
57+ - name : Install toolchain
58+ uses : dtolnay/rust-toolchain@v1
59+ with :
60+ toolchain : ${{ matrix.toolchain }}
61+ components : rustfmt, clippy
62+
63+ - name : Run check
64+ run : cargo check --features "${{ matrix.features }}"
65+
66+ test :
67+ name : Test
68+ needs : [check]
69+ strategy :
70+ matrix :
71+ platform :
72+ - runner : ubuntu-latest
73+ target : x86_64-unknown-linux-gnu
74+ - runner : macOS-latest
75+ target : x86_64-apple-darwin
76+ - runner : macOS-latest
77+ target : aarch64-apple-darwin
78+ - runner : windows-latest
79+ target : x86_64-pc-windows-msvc
80+ toolchain : [stable]
81+ features : [cjk]
82+ runs-on : ${{ matrix.platform.runner }}
83+ steps :
84+ - name : Run checkout
85+ uses : actions/checkout@v4
86+
87+ - name : Install toolchain
88+ uses : dtolnay/rust-toolchain@v1
89+ with :
90+ toolchain : ${{ matrix.toolchain }}
91+ target : ${{ matrix.platform.target }}
92+ components : rustfmt, clippy
93+
94+ - name : Run test
95+ run : cargo test --target "${{ matrix.platform.target }}" --features "${{ matrix.features }}"
96+
1997 linux :
98+ name : Linux
99+ needs : [test]
20100 runs-on : ${{ matrix.platform.runner }}
21101 strategy :
22102 matrix :
@@ -25,14 +105,6 @@ jobs:
25105 target : x86_64
26106 - runner : ubuntu-22.04
27107 target : x86
28- # - runner: ubuntu-22.04
29- # target: aarch64
30- # - runner: ubuntu-22.04
31- # target: armv7
32- # - runner: ubuntu-22.04
33- # target: s390x
34- # - runner: ubuntu-22.04
35- # target: ppc64le
36108 steps :
37109 - name : Run checkout
38110 uses : actions/checkout@v4
49121 args : --release --out dist --find-interpreter --features=cjk
50122 sccache : ' true'
51123 manylinux : auto
52- # before-script-linux: "apt-get update && apt-get install libssl-dev pkg-config -y"
53124 before-script-linux : " yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y"
54125
55126 - name : Upload wheels
@@ -59,22 +130,16 @@ jobs:
59130 path : dist
60131
61132 linux2 :
133+ name : Linux2
134+ needs : [test]
62135 runs-on : ${{ matrix.platform.runner }}
63136 strategy :
64137 matrix :
65138 platform :
66- # - runner: ubuntu-22.04
67- # target: x86_64
68- # - runner: ubuntu-22.04
69- # target: x86
70139 - runner : ubuntu-22.04
71140 target : aarch64
72141 - runner : ubuntu-22.04
73142 target : armv7
74- # - runner: ubuntu-22.04
75- # target: s390x
76- # - runner: ubuntu-22.04
77- # target: ppc64le
78143 steps :
79144 - name : Run checkout
80145 uses : actions/checkout@v4
@@ -100,6 +165,8 @@ jobs:
100165 path : dist
101166
102167 musllinux :
168+ name : MuslLinux
169+ needs : [test]
103170 runs-on : ${{ matrix.platform.runner }}
104171 strategy :
105172 matrix :
@@ -136,44 +203,9 @@ jobs:
136203 name : wheels-musllinux-${{ matrix.platform.target }}
137204 path : dist
138205
139- # musllinux2:
140- # runs-on: ${{ matrix.platform.runner }}
141- # strategy:
142- # matrix:
143- # platform:
144- # # - runner: ubuntu-22.04
145- # # target: x86_64
146- # # - runner: ubuntu-22.04
147- # # target: x86
148- # - runner: ubuntu-22.04
149- # target: aarch64
150- # - runner: ubuntu-22.04
151- # target: armv7
152- # steps:
153- # - name: Run checkout
154- # uses: actions/checkout@v4
155-
156- # - name: Setup Python
157- # uses: actions/setup-python@v5
158- # with:
159- # python-version: 3.x
160-
161- # - name: Build wheels
162- # uses: PyO3/maturin-action@v1
163- # with:
164- # target: ${{ matrix.platform.target }}
165- # args: --release --out dist --find-interpreter --features=cjk
166- # sccache: 'true'
167- # manylinux: musllinux_1_2
168- # before-script-linux: "apt-get update && apt-get install libssl-dev pkg-config -y"
169-
170- # - name: Upload wheels
171- # uses: actions/upload-artifact@v4
172- # with:
173- # name: wheels-musllinux-${{ matrix.platform.target }}
174- # path: dist
175-
176206 windows :
207+ name : Windows
208+ needs : [test]
177209 runs-on : ${{ matrix.platform.runner }}
178210 strategy :
179211 matrix :
@@ -206,6 +238,8 @@ jobs:
206238 path : dist
207239
208240 macos :
241+ name : MacOS
242+ needs : [test]
209243 runs-on : ${{ matrix.platform.runner }}
210244 strategy :
211245 matrix :
@@ -256,9 +290,9 @@ jobs:
256290
257291 release :
258292 name : Release
293+ needs : [linux, linux2, musllinux, windows, macos, sdist]
259294 runs-on : ubuntu-latest
260295 if : ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
261- needs : [linux, musllinux, windows, macos, sdist]
262296 permissions :
263297 # Use to sign the release artifacts
264298 id-token : write
@@ -299,11 +333,11 @@ jobs:
299333
300334 publish-crates :
301335 name : Publish crate
336+ needs : [release]
302337 strategy :
303338 matrix :
304339 os : [ubuntu-latest]
305340 toolchain : [stable]
306- needs : [release]
307341 runs-on : ${{ matrix.os }}
308342 steps :
309343 - name : Checkout
0 commit comments