Skip to content

Commit

Permalink
ci: remove uses of unmaintained actions-rs actions (#5316)
Browse files Browse the repository at this point in the history
- Use dtolnay/rust-toolchain instead of actions-rs/toolchain
- Use cargo/cross directly instead of actions-rs/cargo
- Use rustsec/audit-check instead of actions-rs/audit-check
  • Loading branch information
taiki-e authored Dec 27, 2022
1 parent 682e93d commit 519afd4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 75 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ permissions:
jobs:
security-audit:
permissions:
checks: write # for actions-rs/audit-check to create check
checks: write # for rustsec/audit-check to create check
contents: read # for actions/checkout to fetch code
issues: write # for actions-rs/audit-check to create issues
issues: write # for rustsec/audit-check to create issues
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v3

- name: Audit Check
uses: actions-rs/audit-check@v1
# https://github.com/rustsec/audit-check/issues/2
uses: rustsec/audit-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
87 changes: 29 additions & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- name: Install Rust
run: rustup update stable
- uses: Swatinem/rust-cache@v1
Expand Down Expand Up @@ -123,10 +122,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Enable parking_lot send_guard feature
# Inserts the line "plsend = ["parking_lot/send_guard"]" right after [features]
Expand All @@ -140,10 +138,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1

- name: Install Valgrind
Expand Down Expand Up @@ -179,10 +176,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
# Run `tokio` with "unstable" cfg flag.
- name: test tokio full --cfg unstable
Expand All @@ -200,11 +196,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
components: miri
override: true
- uses: Swatinem/rust-cache@v1
- name: miri
# Many of tests in tokio/tests and doctests use #[tokio::test] or
Expand All @@ -224,10 +219,9 @@ jobs:
# Required to resolve symbols in sanitizer output
run: sudo apt-get install -y llvm
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
override: true
- uses: Swatinem/rust-cache@v1
- name: asan
run: cargo test --workspace --all-features --target x86_64-unknown-linux-gnu --tests -- --test-threads 1
Expand All @@ -250,16 +244,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --workspace --all-features --target ${{ matrix.target }}
- name: Install cross
uses: taiki-e/install-action@cross
- run: cross check --workspace --all-features --target ${{ matrix.target }}
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings

Expand All @@ -280,28 +271,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
target: ${{ matrix.target }}
override: true
- name: Install cross
uses: taiki-e/install-action@cross
# First run with all features (including parking_lot)
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: -p tokio --all-features --target ${{ matrix.target }} --tests
- run: cross test -p tokio --all-features --target ${{ matrix.target }} --tests
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_ipv6 ${{ matrix.rustflags }}
# Now run without parking_lot
- name: Remove `parking_lot` from `full` feature
run: sed -i '0,/parking_lot/{/parking_lot/d;}' tokio/Cargo.toml
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
# The `tokio_no_parking_lot` cfg is here to ensure the `sed` above does not silently break.
args: -p tokio --features full,test-util --target ${{ matrix.target }} --tests
# The `tokio_no_parking_lot` cfg is here to ensure the `sed` above does not silently break.
- run: cross test -p tokio --features full,test-util --target ${{ matrix.target }} --tests
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_ipv6 --cfg tokio_no_parking_lot ${{ matrix.rustflags }}

Expand All @@ -312,11 +296,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
components: rust-src
override: true
# Install linker and libraries for i686-unknown-linux-gnu
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
Expand All @@ -331,11 +314,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
Expand All @@ -353,10 +335,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_min }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_min }}
override: true
- uses: Swatinem/rust-cache@v1
# First compile just the main tokio crate with minrust and newest version
# of all dependencies, then pin once_cell and compile the rest of the
Expand All @@ -378,10 +359,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
Expand Down Expand Up @@ -410,10 +390,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
# Check fmt
Expand All @@ -431,10 +410,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_clippy }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_clippy }}
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
# Run clippy
Expand All @@ -447,10 +425,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
override: true
- uses: Swatinem/rust-cache@v1
- name: "doc --lib --all-features"
run: cargo doc --lib --no-deps --all-features --document-private-items
Expand All @@ -464,10 +441,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
- name: build --cfg loom
run: cargo test --no-run --lib --features full
Expand Down Expand Up @@ -499,10 +475,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Test hyper
run: |
Expand All @@ -527,11 +502,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
target: x86_64-fortanix-unknown-sgx
override: true
- uses: Swatinem/rust-cache@v1
# NOTE: Currently the only test we can run is to build tokio with rt and sync features.
- name: build tokio
Expand All @@ -544,10 +518,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand All @@ -561,10 +534,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1

# Install dependencies
Expand Down Expand Up @@ -614,12 +586,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust nightly-2022-07-25
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
# `check-external-types` requires a specific Rust nightly version. See
# the README for details: https://github.com/awslabs/cargo-check-external-types
toolchain: nightly-2022-07-25
override: true
- uses: Swatinem/rust-cache@v1
- name: check-external-types
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/loom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
- name: loom ${{ matrix.scope }}
run: cargo test --lib --release --features full -- --nocapture $SCOPE
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/pr-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@ jobs:
- uses: actions/checkout@v3

- name: Install cargo-audit
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-audit
run: cargo install cargo-audit

- name: Generate lockfile
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
run: cargo generate-lockfile

- name: Audit dependencies
uses: actions-rs/cargo@v1
with:
command: audit
run: cargo audit
3 changes: 1 addition & 2 deletions .github/workflows/stress-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Install Valgrind
uses: taiki-e/install-action@valgrind
Expand Down

0 comments on commit 519afd4

Please sign in to comment.