diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35daf1cd..0762e08f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,11 @@ name: CI - on: push: branches: [main, development] pull_request: branches: [development] - jobs: tests: runs-on: "${{ matrix.platform.os }}-latest" @@ -32,34 +30,22 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('Cargo.toml') }} + key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.toml') }} restore-keys: ${{ runner.os }}-cargo-${{ matrix.platform.target }} - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - target: ${{ matrix.platform.target }} - profile: minimal - default: true + targets: ${{ matrix.platform.target }} - name: Install test runner for wasm if: matrix.platform.target == 'wasm32-unknown-unknown' run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Stable Build with all features - uses: actions-rs/cargo@v1 - with: - command: build - args: --all-features --target ${{ matrix.platform.target }} + run: cargo build --all-features --target ${{ matrix.platform.target }} - name: Stable Build without features - uses: actions-rs/cargo@v1 - with: - command: build - args: --target ${{ matrix.platform.target }} + run: cargo build --target ${{ matrix.platform.target }} - name: Tests if: matrix.platform.target == 'x86_64-unknown-linux-gnu' || matrix.platform.target == 'x86_64-pc-windows-msvc' || matrix.platform.target == 'aarch64-apple-darwin' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features + run: cargo test --all-features - name: Tests in WASM if: matrix.platform.target == 'wasm32-unknown-unknown' run: wasm-pack test --node -- --all-features @@ -83,14 +69,6 @@ jobs: key: ${{ runner.os }}-cargo-features-${{ hashFiles('Cargo.toml') }} restore-keys: ${{ runner.os }}-cargo-features - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.platform.target }} - profile: minimal - default: true + uses: dtolnay/rust-toolchain@stable - name: Stable Build - uses: actions-rs/cargo@v1 - with: - command: build - args: --no-default-features ${{ matrix.features }} + run: cargo build --no-default-features ${{ matrix.features }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 01768b33..5934a4c5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -19,26 +19,15 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-coverage-cargo-${{ hashFiles('Cargo.toml') }} + restore-keys: ${{ runner.os }}-coverage-cargo - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - default: true + uses: dtolnay/rust-toolchain@nightly - name: Install cargo-tarpaulin - uses: actions-rs/install@v0.1 - with: - crate: cargo-tarpaulin - version: latest - use-tool-cache: true + run: cargo install cargo-tarpaulin - name: Run cargo-tarpaulin - uses: actions-rs/cargo@v1 - with: - command: tarpaulin - args: --out Lcov --all-features -- --test-threads 1 + run: cargo tarpaulin --out Lcov --all-features -- --test-threads 1 - name: Upload to codecov.io - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: fail_ci_if_error: false diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8c7fd083..8fdb5f75 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,36 +6,27 @@ on: pull_request: branches: [ development ] + jobs: lint: runs-on: ubuntu-latest env: TZ: "/usr/share/zoneinfo/your/location" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache .cargo and target uses: actions/cache@v4 with: path: | ~/.cargo ./target - key: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-lint-cargo-${{ hashFiles('Cargo.toml') }} + restore-keys: ${{ runner.os }}-lint-cargo - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true - - run: rustup component add rustfmt - - name: Check formt - uses: actions-rs/cargo@v1 + uses: dtolnay/rust-toolchain@stable with: - command: fmt - args: --all -- --check - - run: rustup component add clippy + components: rustfmt, clippy + - name: Check format + run: cargo fmt --all -- --check - name: Run clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features -- -Drust-2018-idioms -Dwarnings + run: cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings