From 443767acc41eea4cfca3d8ae953ef9f4ba651563 Mon Sep 17 00:00:00 2001 From: Jens Reimann Date: Mon, 27 May 2024 09:48:28 +0200 Subject: [PATCH] ci: refresh a lot of long deprecated CI actions --- .github/workflows/publish.yml | 24 +++++++------- .github/workflows/test.yml | 61 ++++++++++++++++------------------- 2 files changed, 38 insertions(+), 47 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3d0acb..17526d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,16 +11,14 @@ jobs: environment: Crates.io name: Publish Rust crate steps: - - name: Checkout code - uses: actions/checkout@v1 - - name: Setup Rust ${{ matrix.rust-toolchain }} - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - name: Package and publish crate - uses: actions-rs/cargo@v1 - with: - command: publish - args: '--token ${{ secrets.CRATES_IO_TOKEN }}' + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup | Rust + run: | + rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal + rustup default ${{ matrix.rust-toolchain }} + - name: Package and publish crate + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: | + cargo publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b520ee7..1b02925 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,44 +18,37 @@ jobs: - memchr - serde steps: - - name: Checkout code - uses: actions/checkout@v1 - - name: Setup Rust ${{ matrix.rust-toolchain }} - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust-toolchain }} - override: true - - name: Setup cache for cargo - uses: actions/cache@v2 - with: - path: target - key: ${{ runner.os }}-cargo-${{ matrix.rust-toolchain }} - - name: Measure code coverage with ${{ matrix.feature }} feature - uses: actions-rs/tarpaulin@v0.1 - with: - version: '0.16.0' - args: '-v --out Xml --ciserver github-actions --no-default-features --features=${{ matrix.feature }}' - - name: Upload coverage statistics - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - flags: rust-${{ matrix.rust-toolchain }},${{ matrix.feature }} + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup | Rust + run: | + rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal + rustup default ${{ matrix.rust-toolchain }} + - name: Setup cache for cargo + uses: actions/cache@v4 + with: + path: target + key: ${{ runner.os }}-cargo-${{ matrix.rust-toolchain }}-${{ matrix.feature }} + - name: Measure code coverage with ${{ matrix.feature }} feature + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.16.0' + args: '-v --out Xml --ciserver github-actions --no-default-features --features=${{ matrix.feature }}' + - name: Upload coverage statistics + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + flags: rust-${{ matrix.rust-toolchain }},${{ matrix.feature }} lint: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Setup Rust stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt + run: | + rustup toolchain install stable --profile minimal --component rustfmt + rustup default stable - name: Check code format - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: | + cargo fmt --all -- --check