From c44d361828eb6510f24e2d308890d5cf197bc3d2 Mon Sep 17 00:00:00 2001 From: Mrmaxmeier <3913977+Mrmaxmeier@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:44:34 +0200 Subject: [PATCH] CI: Update actions and fix warnings (#2435) * CI: update to checkout@v4 action Not sure why they decided to bump a major version. It seems like this is unnecessary churn: https://github.com/actions/checkout/pull/1436#issuecomment-1737711301 * CI: replace archived `actions-rs/toolchain` It's been unmaintained for four years and has been throwing warnings in CI: > The `set-output` command is deprecated and will be disabled soon. * CI: Bump `cargo-install` action. This should fix the remaining warnings in CI? * CI: mdbook-linkcheck: workaround for build error --- .github/workflows/build_and_test.yml | 104 +++++++----------- .../fuzzer-tester-prepare/action.yml | 10 +- .../qemu-fuzzer-tester-prepare/action.yml | 9 +- .github/workflows/ubuntu-prepare/action.yml | 7 +- .../windows-tester-prepare/action.yml | 9 +- 5 files changed, 55 insertions(+), 84 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 879b752068..b984728fbd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -23,20 +23,24 @@ jobs: os: [ ubuntu-latest, windows-latest, macOS-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - if: runner.os == 'Linux' uses: ./.github/workflows/ubuntu-prepare - name: Install mimetype if: runner.os == 'Linux' run: sudo apt-get install -y libfile-mimeinfo-perl - name: install mdbook - uses: baptiste0928/cargo-install@v1.3.0 + uses: baptiste0928/cargo-install@v3 with: crate: mdbook - name: install linkcheck - uses: baptiste0928/cargo-install@v1.3.0 + uses: baptiste0928/cargo-install@v3 with: crate: mdbook-linkcheck + # NOTE: The current crates.io release of mdbook-linkcheck (v0.7.7) is broken + # => https://github.com/Michael-F-Bryan/mdbook-linkcheck/pull/82#issuecomment-2241058491 + git: https://github.com/Michael-F-Bryan/mdbook-linkcheck.git + rev: 8c783c5d754d83bcd50c28fb4174854b04ece990 - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } if: runner.os == 'Linux' @@ -71,11 +75,8 @@ jobs: steps: - name: Remove Dotnet & Haskell run: rm -rf /usr/share/dotnet && rm -rf /opt/ghc - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 with: { shared-key: "llvm-tester" } - name: Install LLVM and Clang @@ -88,7 +89,7 @@ jobs: ubuntu-doc-build: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 # ---- doc check ---- @@ -98,7 +99,7 @@ jobs: ubuntu-doc-test: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 # ---- doc check ---- @@ -109,7 +110,7 @@ jobs: runs-on: ubuntu-22.04 needs: ubuntu steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 - name: Add nightly clippy @@ -121,7 +122,7 @@ jobs: ubuntu: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } @@ -141,7 +142,7 @@ jobs: ubuntu-clippy: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } @@ -163,7 +164,7 @@ jobs: matrix: instance_idx: [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17" ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } @@ -178,11 +179,8 @@ jobs: runs-on: ubuntu-latest needs: ubuntu steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } - name: Install smoke test deps @@ -193,7 +191,7 @@ jobs: python-bindings: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } @@ -209,7 +207,7 @@ jobs: cargo-fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 with: { shared-key: "ubuntu" } @@ -222,7 +220,7 @@ jobs: fuzzers-preflight: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Fuzzer in CI Check run: ./scripts/check_tested_fuzzers.sh @@ -308,7 +306,7 @@ jobs: - ./fuzzers/others/tutorial runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/fuzzer-tester-prepare - name: Build and run example fuzzers (Linux) if: runner.os == 'Linux' @@ -322,7 +320,7 @@ jobs: outputs: qemu: ${{ steps.filter.outputs.qemu }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 id: filter with: @@ -352,7 +350,7 @@ jobs: runs-on: [ self-hosted, qemu ] container: registry.gitlab.com/qemu-project/qemu/qemu/ubuntu2204:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/qemu-fuzzer-tester-prepare - name: Build and run example QEMU fuzzers (Linux) if: runner.os == 'Linux' @@ -362,13 +360,10 @@ jobs: nostd-build: runs-on: ubuntu-latest steps: - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true components: rust-src - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Add targets run: rustup target add arm-linux-androideabi && rustup target add thumbv6m-none-eabi @@ -382,13 +377,10 @@ jobs: nostd-clippy: runs-on: ubuntu-latest steps: - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true components: clippy, rust-src - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Add targets run: rustup target add arm-linux-androideabi && rustup target add thumbv6m-none-eabi @@ -400,7 +392,7 @@ jobs: build-docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build docker run: docker build -t libafl . @@ -409,7 +401,7 @@ jobs: needs: - common steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/windows-tester-prepare - name: Build fuzzers/frida_libpng run: cd fuzzers/frida/frida_libpng/ && cargo make test @@ -419,7 +411,7 @@ jobs: needs: - common steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/windows-tester-prepare - name: Build fuzzers/stb/libfuzzer_stb_image run: cd fuzzers/stb/libfuzzer_stb_image && cargo build --release @@ -429,7 +421,7 @@ jobs: needs: - common steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/windows-tester-prepare - name: Build fuzzers/frida/frida_gdiplus run: cd fuzzers/frida/frida_gdiplus/ && cargo make test && cargo make test_cmplog @@ -439,7 +431,7 @@ jobs: needs: - common steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/workflows/windows-tester-prepare - name: install cxx bridge run: cargo install cxxbridge-cmd @@ -451,12 +443,9 @@ jobs: needs: - common steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions/checkout@v3 - - uses: ./.github/workflows/windows-tester-prepare + - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v4 + - uses: ./.github/workflows/windows-tester-prepare - uses: Swatinem/rust-cache@v2 - name: Run real clippy, not the fake one shell: pwsh @@ -465,17 +454,14 @@ jobs: macos: runs-on: macOS-latest steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - name: Add nightly clippy run: rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly - name: Install deps run: brew install z3 gtk+3 - name: Install cxxbridge run: cargo install cxxbridge-cmd - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: MacOS Build run: cargo build --verbose @@ -489,13 +475,10 @@ jobs: ios: runs-on: macOS-latest steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - name: install ios run: rustup target add aarch64-apple-ios - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Build iOS run: cargo build --target aarch64-apple-ios && cd libafl_frida && cargo build --target aarch64-apple-ios && cd .. @@ -503,10 +486,7 @@ jobs: android: runs-on: ubuntu-22.04 steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - uses: nttld/setup-ndk@v1 with: ndk-version: r25b @@ -514,7 +494,7 @@ jobs: run: rustup target add aarch64-linux-android - name: install cargo ndk run: cargo install cargo-ndk - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Build Android run: cd libafl && cargo ndk -t arm64-v8a build --release @@ -533,7 +513,7 @@ jobs: runs-on: ubuntu-22.04 name: Simple build in FreeBSD steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Test in FreeBSD id: test uses: vmactions/freebsd-vm@v1 diff --git a/.github/workflows/fuzzer-tester-prepare/action.yml b/.github/workflows/fuzzer-tester-prepare/action.yml index db53cc3cad..08f9dcaee2 100644 --- a/.github/workflows/fuzzer-tester-prepare/action.yml +++ b/.github/workflows/fuzzer-tester-prepare/action.yml @@ -3,7 +3,7 @@ description: Sets up the Rust environment for the CI workflow runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 @@ -26,18 +26,18 @@ runs: shell: bash run: rustup target add wasm32-unknown-unknown - name: install cargo-make - uses: baptiste0928/cargo-install@v1.3.0 + uses: baptiste0928/cargo-install@v3 with: crate: cargo-make - name: install wasm-pack - uses: baptiste0928/cargo-install@v1.3.0 + uses: baptiste0928/cargo-install@v3 with: crate: wasm-pack - name: install cxxbridge-cmd - uses: baptiste0928/cargo-install@v1.3.0 + uses: baptiste0928/cargo-install@v3 with: crate: cxxbridge-cmd - name: install chrome uses: browser-actions/setup-chrome@v1 with: - chrome-version: stable \ No newline at end of file + chrome-version: stable diff --git a/.github/workflows/qemu-fuzzer-tester-prepare/action.yml b/.github/workflows/qemu-fuzzer-tester-prepare/action.yml index c3016aac03..37c97a0054 100644 --- a/.github/workflows/qemu-fuzzer-tester-prepare/action.yml +++ b/.github/workflows/qemu-fuzzer-tester-prepare/action.yml @@ -3,7 +3,7 @@ description: Sets up the QEMU fuzzers environment runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 @@ -13,10 +13,7 @@ runs: - uses: ./.github/workflows/ubuntu-prepare - uses: Swatinem/rust-cache@v2 with: { shared-key: "${{ runner.os }}-shared-fuzzer-cache" } - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - name: pip install shell: bash run: python3 -m pip install msgpack jinja2 find_libpython @@ -24,6 +21,6 @@ runs: shell: bash run: export MAKEFLAGS="-j$(expr $(nproc) \+ 1)" - name: install cargo-make - uses: baptiste0928/cargo-install@v1.3.0 + uses: baptiste0928/cargo-install@v3 with: crate: cargo-make diff --git a/.github/workflows/ubuntu-prepare/action.yml b/.github/workflows/ubuntu-prepare/action.yml index 0ed874617a..515c726941 100644 --- a/.github/workflows/ubuntu-prepare/action.yml +++ b/.github/workflows/ubuntu-prepare/action.yml @@ -6,10 +6,7 @@ runs: - name: Install and cache deps shell: bash run: sudo apt-get update && sudo apt-get install -y curl lsb-release wget software-properties-common gnupg ninja-build shellcheck pax-utils nasm libsqlite3-dev libc6-dev libgtk-3-dev gcc g++ gcc-arm-none-eabi gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev build-essential - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - name: Add stable clippy shell: bash run: rustup toolchain install stable --component clippy --allow-downgrade @@ -43,4 +40,4 @@ runs: run: sudo apt-get update && sudo apt-get install -y llvm llvm-dev clang libclang-cpp-dev llvm-${{ env.MAIN_LLVM_VERSION }} clang-${{ env.MAIN_LLVM_VERSION }} llvm-${{ env.MAIN_LLVM_VERSION }}-dev libclang-cpp${{ env.MAIN_LLVM_VERSION }} libclang-cpp${{ env.MAIN_LLVM_VERSION }}-dev - name: Symlink Headers shell: bash - run: sudo ln -s /usr/include/asm-generic /usr/include/asm \ No newline at end of file + run: sudo ln -s /usr/include/asm-generic /usr/include/asm diff --git a/.github/workflows/windows-tester-prepare/action.yml b/.github/workflows/windows-tester-prepare/action.yml index 87031d85fc..a76f1a89e6 100644 --- a/.github/workflows/windows-tester-prepare/action.yml +++ b/.github/workflows/windows-tester-prepare/action.yml @@ -3,13 +3,10 @@ description: Sets up the Rust environment for the CI workflow runs: using: composite steps: - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly components: llvm-tools, clippy, rustfmt - default: true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Build docs shell: pwsh @@ -20,4 +17,4 @@ runs: run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: install cargo-make shell: pwsh - run: cargo install --force cargo-make \ No newline at end of file + run: cargo install --force cargo-make