From 5c924ccf9abb132281b7cb8e06bffda36f36e20d Mon Sep 17 00:00:00 2001 From: Philip Sampaio Date: Thu, 6 Apr 2023 19:15:38 -0300 Subject: [PATCH] Use updated GitHub Actions (#33) This changes the action responsible for installing Rust to one that is better maintained. It also updates the "official" actions for checkout and caching. --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/gh-pages.yml | 16 +++++++++------- .github/workflows/release.yml | 2 +- .github/workflows/rust-ci.yml | 24 ++++++++++-------------- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b512df0..176f730 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,8 @@ jobs: runs-on: ubuntu-latest name: test steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: | deps @@ -25,7 +25,7 @@ jobs: key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} restore-keys: | ${{ runner.os }}-mix- - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: | ~/.cargo/bin/ @@ -34,10 +34,10 @@ jobs: ~/.cargo/git/db/ native/ex_tokenizers/target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - uses: erlef/setup-beam@v1 with: otp-version: "${{ env.OTP_VERSION }}" @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest name: mix format steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: erlef/setup-beam@v1 with: otp-version: "${{ env.OTP_VERSION }}" diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 85bedc2..a3ad567 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -18,8 +18,9 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/checkout@v3 + + - uses: actions/cache@v3 with: path: | deps @@ -27,7 +28,8 @@ jobs: key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} restore-keys: | ${{ runner.os }}-mix- - - uses: actions/cache@v2 + + - uses: actions/cache@v3 with: path: | ~/.cargo/bin/ @@ -36,10 +38,10 @@ jobs: ~/.cargo/git/db/ native/ex_tokenizers/target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - uses: erlef/setup-beam@v1 with: otp-version: "${{ env.OTP_VERSION }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7a7f5c..9ff73a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: - name: Build the project id: build-crate - uses: philss/rustler-precompiled-action@v1.0.0 + uses: philss/rustler-precompiled-action@v1.0.1 with: nif-version: ${{ matrix.nif }} project-dir: "native/ex_tokenizers" diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 874ec76..29a1001 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -19,7 +19,8 @@ jobs: - native/ex_tokenizers/Cargo.toml steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: | @@ -32,19 +33,14 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- - - uses: actions-rs/toolchain@v1 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true + components: rustfmt, clippy + - name: run rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --manifest-path=${{ matrix.manifest }} --all -- --check + run: cargo fmt --manifest-path=${{ matrix.manifest }} --all -- --check + - name: run clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=${{ matrix.manifest }} -- -Dwarnings + run: cargo clippy --manifest-path=${{ matrix.manifest }} -- -Dwarnings