diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1e621c6c..a53397f4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -20,7 +20,6 @@ Long form explanations of most of the items below can be found in the [CONTRIBUT - [ ] update [example config file section](https://epi052.github.io/feroxbuster-docs/docs/configuration/ferox-config-toml/) - [ ] update [help output section](https://epi052.github.io/feroxbuster-docs/docs/configuration/command-line/) - [ ] add an [example](https://epi052.github.io/feroxbuster-docs/docs/examples/) - - [ ] update [comparison table](https://epi052.github.io/feroxbuster-docs/docs/compare/) ## Additional Tests - [ ] New code is unit tested diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f93f59cf..7f408422 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,37 +37,26 @@ jobs: path: target/aarch64-unknown-linux-gnu/release/feroxbuster pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig steps: - - uses: actions/checkout@v2 - - name: Install System Dependencies - run: | - env - sudo apt-get update - sudo apt-get install -y --no-install-recommends libssl-dev pkg-config gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true - - uses: actions-rs/cargo@v1 - env: - PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }} - OPENSSL_DIR: /usr/lib/ssl + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 with: - use-cross: true command: build - args: --release --target=${{ matrix.target }} - - name: Strip symbols from binary - run: | - strip -s ${{ matrix.path }} || arm-linux-gnueabihf-strip -s ${{ matrix.path }} || aarch64-linux-gnu-strip -s ${{ matrix.path }} + target: ${{ matrix.target }} + args: "--locked --release" + strip: true + toolchain: stable - name: Build tar.gz for homebrew installs if: matrix.type == 'ubuntu-x64' run: | tar czf ${{ matrix.name }}.tar.gz -C target/x86_64-unknown-linux-musl/release feroxbuster - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.name }} path: ${{ matrix.path }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: matrix.type == 'ubuntu-x64' with: name: ${{ matrix.name }}.tar.gz @@ -78,26 +67,25 @@ jobs: IN_PIPELINE: true runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Install System Dependencies run: | env sudo apt-get update - sudo apt-get install -y --no-install-recommends libssl-dev pkg-config - - uses: actions-rs/toolchain@v1 + sudo apt-get install -y --no-install-recommends libssl-dev pkg-config musl-tools + - name: Set up Rust toolchain + uses: dtolnay/rust-toolchain@master with: toolchain: stable target: x86_64-unknown-linux-musl - override: true - - uses: actions-rs/cargo@v1 + + - name: Build the project env: PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig OPENSSL_DIR: /usr/lib/ssl - with: - use-cross: true - command: build - args: --target=x86_64-unknown-linux-musl - - uses: actions/upload-artifact@v2 + run: cargo build --target=x86_64-unknown-linux-musl + - uses: actions/upload-artifact@v4 with: name: x86_64-linux-debug-feroxbuster path: target/x86_64-unknown-linux-musl/debug/feroxbuster @@ -108,7 +96,7 @@ jobs: env: IN_PIPELINE: true steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Install cargo-deb run: cargo install -f cargo-deb - uses: awalsh128/cache-apt-pkgs-action@v1 @@ -120,7 +108,7 @@ jobs: - name: Deb Build run: cargo deb --target=x86_64-unknown-linux-musl - name: Upload Deb Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: feroxbuster_amd64.deb path: ./target/x86_64-unknown-linux-musl/debian/* @@ -131,28 +119,25 @@ jobs: runs-on: macos-latest if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 with: - toolchain: stable - target: x86_64-apple-darwin - override: true - - uses: actions-rs/cargo@v1 - with: - use-cross: true command: build - args: --release --target=x86_64-apple-darwin - - name: Strip symbols from binary - run: | - strip -u -r target/x86_64-apple-darwin/release/feroxbuster + target: x86_64-apple-darwin + args: "--locked --release" + strip: true + toolchain: stable - name: Build tar.gz for homebrew installs run: | tar czf x86_64-macos-feroxbuster.tar.gz -C target/x86_64-apple-darwin/release feroxbuster - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: x86_64-macos-feroxbuster path: target/x86_64-apple-darwin/release/feroxbuster - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: x86_64-macos-feroxbuster.tar.gz path: x86_64-macos-feroxbuster.tar.gz @@ -161,30 +146,27 @@ jobs: env: IN_PIPELINE: true runs-on: macos-latest - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: aarch64-apple-darwin - override: true - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 with: - use-cross: true command: build - args: --release --target=aarch64-apple-darwin - - name: Strip symbols from binary - run: | - strip -u -r target/aarch64-apple-darwin/release/feroxbuster + target: aarch64-apple-darwin + args: "--locked --release" + strip: true + toolchain: stable - name: Build tar.gz for homebrew installs run: | tar czf aarch64-macos-feroxbuster.tar.gz -C target/aarch64-apple-darwin/release feroxbuster - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: aarch64-macos-feroxbuster path: target/aarch64-apple-darwin/release/feroxbuster - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: aarch64-macos-feroxbuster.tar.gz path: aarch64-macos-feroxbuster.tar.gz @@ -209,18 +191,18 @@ jobs: name: x86-windows-feroxbuster.exe path: target\i686-pc-windows-msvc\release\feroxbuster.exe steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 with: - toolchain: stable - target: ${{ matrix.target }} - override: true - - uses: actions-rs/cargo@v1 - with: - use-cross: true command: build - args: --release --target=${{ matrix.target }} - - uses: actions/upload-artifact@v2 + target: ${{ matrix.target }} + args: "--locked --release" + strip: true + toolchain: stable + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.name }} path: ${{ matrix.path }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 76bf7560..fd6568cc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,40 +7,41 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/cargo@v1 - with: - command: check + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check test: name: Test Suite runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 - name: Install latest nextest release uses: taiki-e/install-action@nextest + - uses: dtolnay/rust-toolchain@stable - name: Test with latest nextest release - uses: actions-rs/cargo@v1 - with: - command: nextest - args: run --all-features --all-targets + run: cargo nextest run --all-features --all-targets --retries 4 --no-fail-fast fmt: name: Rust fmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable + - run: cargo fmt --all -- --check clippy: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets --all-features -- -D warnings + - uses: actions/checkout@v4 + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - uses: dtolnay/rust-toolchain@stable + - run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/.github/workflows/cicd-to-dockerhub.yml b/.github/workflows/cicd-to-dockerhub.yml index 863c5084..dd6d00fa 100644 --- a/.github/workflows/cicd-to-dockerhub.yml +++ b/.github/workflows/cicd-to-dockerhub.yml @@ -9,21 +9,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: context: ./ file: ./Dockerfile diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4a37b89d..52260a1d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,7 +7,7 @@ jobs: name: LLVM Coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: llvm-tools-preview @@ -16,9 +16,10 @@ jobs: with: tool: cargo-nextest,cargo-llvm-cov - name: Generate code coverage - run: cargo llvm-cov nextest --all-features --no-fail-fast --lcov --output-path lcov.info + run: cargo llvm-cov nextest --all-features --no-fail-fast --lcov --retries 4 --output-path lcov.info - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: lcov.info fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/Makefile.toml b/Makefile.toml index 49b8df0b..92df1386 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -37,5 +37,5 @@ cargo fmt --all [tasks.test] clear = true script = """ -cargo nextest run --all-features --all-targets +cargo nextest run --all-features --all-targets --retries 4 --no-fail-fast """