Skip to content

Commit

Permalink
Use updated GitHub Actions (#33)
Browse files Browse the repository at this point in the history
This changes the action responsible for installing Rust to one that is
better maintained. It also updates the "official" actions for checkout
and caching.
  • Loading branch information
philss authored Apr 6, 2023
1 parent eeb3453 commit 5c924cc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 30 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ 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
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
Expand All @@ -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 }}"
Expand All @@ -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 }}"
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ 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
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
Expand All @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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

0 comments on commit 5c924cc

Please sign in to comment.