Skip to content

Commit

Permalink
ci: Upgrade ci dependencies and switch to nextest (#446)
Browse files Browse the repository at this point in the history
* ci: Upgrade rust-cache to v2.2.0

v2.0.0 uses API that is deprecated

* ci: Use --workspace in cargo llvm-cov

* ci: Replace actions-rs/toolchain by dtolnay/rust-toolchain

actions-rs/toolchain is under inactive maintenance, it uses node12 that
would soon becomes deprecated

* ci: Replace actions-rs/cargo by run

* ci: rust-cache and cleanup-disk-action try not to specific full version

* ci: Use nextest

Also sets timeout for nextest to avoid a test hanging too long

* ci: Upgrade actions/checkout to v3

To upgrade node from 12 to 16

* ci: Specific cleanup-disk-action version
  • Loading branch information
evenyag authored Nov 10, 2022
1 parent 2e9c9f2 commit 3ae7362
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[profile.default]
slow-timeout = { period = "60s", terminate-after = 3, grace-period = "30s" }
11 changes: 6 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,25 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v1
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: llvm-tools-preview
- name: Rust Cache
uses: Swatinem/rust-cache@v2.0.0
uses: Swatinem/rust-cache@v2
- name: Cleanup disk
uses: curoky/cleanup-disk-action@v2.0
with:
retain: 'rust'
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
run: cargo llvm-cov --lcov --output-path lcov.info
run: cargo llvm-cov nextest --workspace --lcov --output-path lcov.info
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
Expand Down
62 changes: 24 additions & 38 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,23 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v1
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.0.0
- uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-targets
uses: Swatinem/rust-cache@v2
- name: Run cargo check
run: cargo check --workspace --all-targets

test:
name: Test Suite
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v3
Expand All @@ -59,21 +55,19 @@ jobs:
with:
version: "14.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.0.0
uses: Swatinem/rust-cache@v2
- name: Cleanup disk
uses: curoky/cleanup-disk-action@v2.0
with:
retain: 'rust,llvm'
- uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Run tests
run: cargo nextest run
env:
CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=lld"
RUST_BACKTRACE: 1
Expand All @@ -88,38 +82,30 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v1
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@v2.0.0
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: cargo fmt --all -- --check

clippy:
name: Clippy
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v1
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2.0.0
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr
15 changes: 5 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,17 @@ jobs:
sudo apt-get -y update
sudo apt-get -y install libssl-dev pkg-config g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
target: ${{ matrix.arch }}
targets: ${{ matrix.arch }}

- name: Output package versions
run: protoc --version ; cargo version ; rustc --version ; gcc --version ; g++ --version

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: ${{ matrix.opts }} --release --locked --target ${{ matrix.arch }}
run: cargo build ${{ matrix.opts }} --release --locked --target ${{ matrix.arch }}

- name: Calculate checksum and rename binary
shell: bash
Expand Down Expand Up @@ -124,7 +119,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Download amd64 binary
uses: actions/download-artifact@v3
Expand Down

0 comments on commit 3ae7362

Please sign in to comment.