From 3636d1d3e99ac5bef987237230aa41faa3c1f821 Mon Sep 17 00:00:00 2001 From: Minoru Osuka Date: Fri, 13 Dec 2024 14:44:15 +0900 Subject: [PATCH 1/2] Fix workflows --- .github/workflows/periodic.yml | 48 +++++++++++- .github/workflows/release.yml | 129 +++++++++++++++++++-------------- 2 files changed, 122 insertions(+), 55 deletions(-) diff --git a/.github/workflows/periodic.yml b/.github/workflows/periodic.yml index beac515..03032f0 100644 --- a/.github/workflows/periodic.yml +++ b/.github/workflows/periodic.yml @@ -6,6 +6,52 @@ on: - cron: 0 0 * * SUN jobs: + fmt: + name: Format + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + toolchain: [stable] + features: [cjk] + runs-on: ${{ matrix.platform.runner }} + steps: + - name: Run checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + + - name: Check format + run: cargo fmt --all -- --check + + check: + name: Check + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + toolchain: [stable] + features: [cjk] + runs-on: ${{ matrix.platform.runner }} + steps: + - name: Run checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + + - name: Run check + run: cargo check --features "${{ matrix.features }}" + test: strategy: matrix: @@ -18,7 +64,7 @@ jobs: target: aarch64-apple-darwin - runner: windows-latest target: x86_64-pc-windows-msvc - toolchain: [stable, beta, nightly] + toolchain: [stable] features: [cjk] runs-on: ${{ matrix.platform.runner }} steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5bf153d..4614c5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,81 @@ permissions: contents: read jobs: + fmt: + name: Format + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + toolchain: [stable] + features: [cjk] + runs-on: ${{ matrix.platform.runner }} + steps: + - name: Run checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + + - name: Check format + run: cargo fmt --all -- --check + + check: + name: Check + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + toolchain: [stable] + features: [cjk] + runs-on: ${{ matrix.platform.runner }} + steps: + - name: Run checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + + - name: Run check + run: cargo check --features "${{ matrix.features }}" + + test: + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64-unknown-linux-gnu + - runner: macOS-latest + target: x86_64-apple-darwin + - runner: macOS-latest + target: aarch64-apple-darwin + - runner: windows-latest + target: x86_64-pc-windows-msvc + toolchain: [stable] + features: [cjk] + runs-on: ${{ matrix.platform.runner }} + steps: + - name: Run checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.platform.target }} + components: rustfmt, clippy + + - name: Run test + run: cargo test --target "${{ matrix.platform.target }}" --features "${{ matrix.features }}" + linux: runs-on: ${{ matrix.platform.runner }} strategy: @@ -25,14 +100,6 @@ jobs: target: x86_64 - runner: ubuntu-22.04 target: x86 - # - runner: ubuntu-22.04 - # target: aarch64 - # - runner: ubuntu-22.04 - # target: armv7 - # - runner: ubuntu-22.04 - # target: s390x - # - runner: ubuntu-22.04 - # target: ppc64le steps: - name: Run checkout uses: actions/checkout@v4 @@ -49,7 +116,6 @@ jobs: args: --release --out dist --find-interpreter --features=cjk sccache: 'true' manylinux: auto - # before-script-linux: "apt-get update && apt-get install libssl-dev pkg-config -y" before-script-linux: "yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y" - name: Upload wheels @@ -63,18 +129,10 @@ jobs: strategy: matrix: platform: - # - runner: ubuntu-22.04 - # target: x86_64 - # - runner: ubuntu-22.04 - # target: x86 - runner: ubuntu-22.04 target: aarch64 - runner: ubuntu-22.04 target: armv7 - # - runner: ubuntu-22.04 - # target: s390x - # - runner: ubuntu-22.04 - # target: ppc64le steps: - name: Run checkout uses: actions/checkout@v4 @@ -136,43 +194,6 @@ jobs: name: wheels-musllinux-${{ matrix.platform.target }} path: dist - # musllinux2: - # runs-on: ${{ matrix.platform.runner }} - # strategy: - # matrix: - # platform: - # # - runner: ubuntu-22.04 - # # target: x86_64 - # # - runner: ubuntu-22.04 - # # target: x86 - # - runner: ubuntu-22.04 - # target: aarch64 - # - runner: ubuntu-22.04 - # target: armv7 - # steps: - # - name: Run checkout - # uses: actions/checkout@v4 - - # - name: Setup Python - # uses: actions/setup-python@v5 - # with: - # python-version: 3.x - - # - name: Build wheels - # uses: PyO3/maturin-action@v1 - # with: - # target: ${{ matrix.platform.target }} - # args: --release --out dist --find-interpreter --features=cjk - # sccache: 'true' - # manylinux: musllinux_1_2 - # before-script-linux: "apt-get update && apt-get install libssl-dev pkg-config -y" - - # - name: Upload wheels - # uses: actions/upload-artifact@v4 - # with: - # name: wheels-musllinux-${{ matrix.platform.target }} - # path: dist - windows: runs-on: ${{ matrix.platform.runner }} strategy: From 7ba83e5e16eb82fd7e440ca88beea8c9ccb81a9e Mon Sep 17 00:00:00 2001 From: Minoru Osuka Date: Fri, 13 Dec 2024 14:52:50 +0900 Subject: [PATCH 2/2] Update workflows --- .github/workflows/periodic.yml | 3 +++ .github/workflows/regression.yml | 3 +++ .github/workflows/release.yml | 17 +++++++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/periodic.yml b/.github/workflows/periodic.yml index 03032f0..5586080 100644 --- a/.github/workflows/periodic.yml +++ b/.github/workflows/periodic.yml @@ -31,6 +31,7 @@ jobs: check: name: Check + needs: [fmt] strategy: matrix: platform: @@ -53,6 +54,8 @@ jobs: run: cargo check --features "${{ matrix.features }}" test: + name: Test + needs: [check] strategy: matrix: platform: diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3a50a5c..298bd1a 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -34,6 +34,7 @@ jobs: check: name: Check + needs: [fmt] strategy: matrix: platform: @@ -56,6 +57,8 @@ jobs: run: cargo check --features "${{ matrix.features }}" test: + name: Test + needs: [check] strategy: matrix: platform: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4614c5f..a36b673 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,7 @@ jobs: check: name: Check + needs: [fmt] strategy: matrix: platform: @@ -63,6 +64,8 @@ jobs: run: cargo check --features "${{ matrix.features }}" test: + name: Test + needs: [check] strategy: matrix: platform: @@ -92,6 +95,8 @@ jobs: run: cargo test --target "${{ matrix.platform.target }}" --features "${{ matrix.features }}" linux: + name: Linux + needs: [test] runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -125,6 +130,8 @@ jobs: path: dist linux2: + name: Linux2 + needs: [test] runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -158,6 +165,8 @@ jobs: path: dist musllinux: + name: MuslLinux + needs: [test] runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -195,6 +204,8 @@ jobs: path: dist windows: + name: Windows + needs: [test] runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -227,6 +238,8 @@ jobs: path: dist macos: + name: MacOS + needs: [test] runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -277,9 +290,9 @@ jobs: release: name: Release + needs: [linux, linux2, musllinux, windows, macos, sdist] runs-on: ubuntu-latest if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} - needs: [linux, musllinux, windows, macos, sdist] permissions: # Use to sign the release artifacts id-token: write @@ -320,11 +333,11 @@ jobs: publish-crates: name: Publish crate + needs: [release] strategy: matrix: os: [ubuntu-latest] toolchain: [stable] - needs: [release] runs-on: ${{ matrix.os }} steps: - name: Checkout