From d2d82931ab6a553d2293c3eb978152d7fa748e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mizar=20/=20=E3=81=BF=E3=81=96=E3=83=BC?= Date: Sun, 26 Mar 2023 23:31:05 +0900 Subject: [PATCH] Tentative solution for CI (Clippy error, deprecated warning) (#117) * ci.yml to use Node16 * `actions/checkout@v3` * `actions/setup-python@v4` * `actions-rs` is unmaintained: * https://github.com/actions-rs/toolchain/issues/219 * https://github.com/actions-rs/cargo/issues/222 * Library Checker: Rust 1.60 * https://judge.yosupo.jp/help * clippy allow renamed-and-removed-lints * https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#renamed-and-removed-lints * `cargo`, `rustup` execute from `$PATH` * uses dtolnay/rust-toolchain@master --- .github/workflows/ci.yml | 78 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cf89aa..23addfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,21 +22,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: 'Setup `${{ matrix.toolchain }}`' - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - override: true - profile: minimal components: rustfmt + - name: 'Override `${{ matrix.toolchain }}' + run: | + rustup override set ${{ matrix.toolchain }} + - name: cargo-fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: | + cargo fmt --all -- --check build: strategy: @@ -66,33 +66,29 @@ jobs: if: matrix.os == 'windows-2019' - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: 'Setup `${{ matrix.toolchain }}`' - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - override: true - profile: minimal components: clippy + - name: 'Override `${{ matrix.toolchain }}`' + run: | + rustup override set ${{ matrix.toolchain }} + - name: cargo-clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace --all-targets -- -D warnings + run: | + cargo clippy --workspace --all-targets -- -A renamed-and-removed-lints -D warnings - name: cargo-build - uses: actions-rs/cargo@v1 - with: - command: build - args: --workspace --all-targets + run: | + cargo build --workspace --all-targets - name: cargo-test - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --no-fail-fast + run: | + cargo test --workspace --no-fail-fast env: RUST_BACKTRACE: full @@ -112,18 +108,20 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: 'Setup `${{ matrix.toolchain }}`' - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - override: true - profile: minimal components: rustfmt + - name: 'Override `${{ matrix.toolchain }}`' + run: | + rustup override set ${{ matrix.toolchain }} + - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -136,17 +134,19 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Setup `1.47.0-x86_64-unknown-linux-gnu` - uses: actions-rs/toolchain@v1 + - name: Setup `1.60.0-x86_64-unknown-linux-gnu` + uses: dtolnay/rust-toolchain@master with: - toolchain: 1.47.0-x86_64-unknown-linux-gnu - override: true - profile: minimal + toolchain: 1.60.0-x86_64-unknown-linux-gnu + + - name: 'Override `1.60.0-x86_64-unknown-linux-gnu' + run: | + rustup override set 1.60.0-x86_64-unknown-linux-gnu - name: Setup Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.9' @@ -154,10 +154,8 @@ jobs: run: pip install online-judge-tools - name: cargo-build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --examples + run: | + cargo build --release --examples - name: Verify run: |