Skip to content

Commit 953aaa0

Browse files
authored
Merge pull request #41 from lindera/workflows
Fix workflows
2 parents a974c9f + 7ba83e5 commit 953aaa0

File tree

3 files changed

+143
-57
lines changed

3 files changed

+143
-57
lines changed

.github/workflows/periodic.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,56 @@ on:
66
- cron: 0 0 * * SUN
77

88
jobs:
9+
fmt:
10+
name: Format
11+
strategy:
12+
matrix:
13+
platform:
14+
- runner: ubuntu-latest
15+
target: x86_64
16+
toolchain: [stable]
17+
features: [cjk]
18+
runs-on: ${{ matrix.platform.runner }}
19+
steps:
20+
- name: Run checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install toolchain
24+
uses: dtolnay/rust-toolchain@v1
25+
with:
26+
toolchain: ${{ matrix.toolchain }}
27+
components: rustfmt, clippy
28+
29+
- name: Check format
30+
run: cargo fmt --all -- --check
31+
32+
check:
33+
name: Check
34+
needs: [fmt]
35+
strategy:
36+
matrix:
37+
platform:
38+
- runner: ubuntu-latest
39+
target: x86_64
40+
toolchain: [stable]
41+
features: [cjk]
42+
runs-on: ${{ matrix.platform.runner }}
43+
steps:
44+
- name: Run checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Install toolchain
48+
uses: dtolnay/rust-toolchain@v1
49+
with:
50+
toolchain: ${{ matrix.toolchain }}
51+
components: rustfmt, clippy
52+
53+
- name: Run check
54+
run: cargo check --features "${{ matrix.features }}"
55+
956
test:
57+
name: Test
58+
needs: [check]
1059
strategy:
1160
matrix:
1261
platform:
@@ -18,7 +67,7 @@ jobs:
1867
target: aarch64-apple-darwin
1968
- runner: windows-latest
2069
target: x86_64-pc-windows-msvc
21-
toolchain: [stable, beta, nightly]
70+
toolchain: [stable]
2271
features: [cjk]
2372
runs-on: ${{ matrix.platform.runner }}
2473
steps:

.github/workflows/regression.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434

3535
check:
3636
name: Check
37+
needs: [fmt]
3738
strategy:
3839
matrix:
3940
platform:
@@ -56,6 +57,8 @@ jobs:
5657
run: cargo check --features "${{ matrix.features }}"
5758

5859
test:
60+
name: Test
61+
needs: [check]
5962
strategy:
6063
matrix:
6164
platform:

.github/workflows/release.yml

Lines changed: 90 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,87 @@ permissions:
1616
contents: read
1717

1818
jobs:
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
@@ -49,7 +121,6 @@ jobs:
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

Comments
 (0)