diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f01b9ed..4e69d931 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,60 +9,6 @@ on: name: CI jobs: - # build_and_test: - # name: Rust project - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # include: - # - os: macOS-latest - # bin: gping - # target: aarch64-apple-darwin - # extension: .tar.gz - # - os: windows-latest - # bin: gping.exe - # name: gping-Windows-x86_64.zip - # env: - # RUST_BACKTRACE: "1" - # steps: - # - uses: actions/checkout@v4 - # - # - name: Install Rust - # uses: dtolnay/rust-toolchain@stable - # - uses: Swatinem/rust-cache@v2 - # with: - # prefix-key: standard-build-${{ matrix.os }}- - # - # - name: Run tests - # run: cargo test - # - # - name: Run - # run: cargo run -- --help - # - # - name: Build release - # if: startsWith(github.ref, 'refs/tags/') - # run: cargo build --release - # - name: Package - # if: startsWith(github.ref, 'refs/tags/') - # shell: bash - # run: | - # strip target/release/${{ matrix.bin }} - # cd target/release - # if [[ "${{ matrix.os }}" == "windows-latest" ]] - # then - # 7z a ../../${{ matrix.name }} ${{ matrix.bin }} - # else - # tar czvf ../../${{ matrix.name }} ${{ matrix.bin }} - # fi - # cd - - # - name: Archive binaries - # uses: actions/upload-artifact@v4 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # name: build-${{ matrix.name }} - # path: ${{ matrix.name }} - cross_builds: name: ${{ matrix.target }} runs-on: ${{ matrix.os }} @@ -90,8 +36,9 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: + cache-on-failure: false target: ${{ matrix.target }} - uses: Swatinem/rust-cache@v2 @@ -145,22 +92,20 @@ jobs: - uses: actions/setup-python@v5 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - prefix-key: checks-build- + cache-on-failure: false + components: rustfmt,clippy - - name: Run cargo fmt - if: success() || failure() - run: cargo fmt --all -- --check + - name: Rustfmt Check + uses: actions-rust-lang/rustfmt@v1 - name: Run cargo check if: success() || failure() run: cargo check - if: success() || failure() - run: cargo clippy --all-targets --all-features -- -D warnings + run: cargo clippy --all-targets --all-features --locked -- -D - - uses: pre-commit/action@v3.0.1 + - if: success() || failure() + uses: pre-commit/action@v3.0.1