diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index 4c09c462..770d1dd9 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -33,7 +33,6 @@ permissions: contents: read attestations: write -# TODO: Maybe add retry job in case of timeouts? jobs: build-binaries: name: "Build binaries" @@ -237,8 +236,8 @@ jobs: name: "release-${{ matrix.info.target }}" path: release - build-with-vm: - name: "Build binaries via VMs" + build-freebsd: + name: "Build FreeBSD binaries" runs-on: "ubuntu-latest" timeout-minutes: 12 strategy: @@ -250,21 +249,9 @@ jobs: # Alas, that's why we do it with VMs. - - { - type: "freebsd", - os_release: "15.0", - target: "x86_64-unknown-freebsd", - } - - { - type: "freebsd", - os_release: "14.3", - target: "x86_64-unknown-freebsd", - } - - { - type: "freebsd", - os_release: "13.5", - target: "x86_64-unknown-freebsd", - } + - { os_release: "15.0", target: "x86_64-unknown-freebsd" } + - { os_release: "14.3", target: "x86_64-unknown-freebsd" } + - { os_release: "13.5", target: "x86_64-unknown-freebsd" } steps: - name: Checkout repository if: matrix.info.container == '' @@ -272,8 +259,8 @@ jobs: with: fetch-depth: 1 - - name: Build (FreeBSD) - if: ${{ matrix.info.type == 'freebsd' }} + # The VM jobs randomly fail, and since GHA can't retry, we retry manually. + - name: Build (Attempt 1) uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4 with: release: "${{ matrix.info.os_release }}" @@ -286,6 +273,41 @@ jobs: run: | . "$HOME/.cargo/env" BTM_GENERATE=true BTM_BUILD_RELEASE_CALLER=${{ inputs.caller }} cargo build --release --locked --target=${{ matrix.info.target }} --features deploy + id: upload_attempt_1 + continue-on-error: true + + - name: Build (Attempt 2) + uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4 + with: + release: "${{ matrix.info.os_release }}" + envs: "RUST_BACKTRACE CARGO_INCREMENTAL CARGO_PROFILE_DEV_DEBUG CARGO_HUSKY_DONT_INSTALL_HOOKS COMPLETION_DIR MANPAGE_DIR" + usesh: true + prepare: | + pkg install -y curl bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh + sh rustup.sh --default-toolchain stable -y + run: | + . "$HOME/.cargo/env" + BTM_GENERATE=true BTM_BUILD_RELEASE_CALLER=${{ inputs.caller }} cargo build --release --locked --target=${{ matrix.info.target }} --features deploy + if: steps.upload_attempt_1.outcome == 'failure' + id: upload_attempt_2 + continue-on-error: true + + - name: Build (Attempt 3) + uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4 + with: + release: "${{ matrix.info.os_release }}" + envs: "RUST_BACKTRACE CARGO_INCREMENTAL CARGO_PROFILE_DEV_DEBUG CARGO_HUSKY_DONT_INSTALL_HOOKS COMPLETION_DIR MANPAGE_DIR" + usesh: true + prepare: | + pkg install -y curl bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh + sh rustup.sh --default-toolchain stable -y + run: | + . "$HOME/.cargo/env" + BTM_GENERATE=true BTM_BUILD_RELEASE_CALLER=${{ inputs.caller }} cargo build --release --locked --target=${{ matrix.info.target }} --features deploy + if: steps.upload_attempt_2.outcome == 'failure' + id: upload_attempt_3 - name: Move automatically generated completion/manpage shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6789849..b203f708 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,21 +281,9 @@ jobs: # # Alas, that's why we do it with VMs. - - { - type: "freebsd", - os_release: "15.0", - target: "x86_64-unknown-freebsd", - } - - { - type: "freebsd", - os_release: "14.3", - target: "x86_64-unknown-freebsd", - } - - { - type: "freebsd", - os_release: "13.5", - target: "x86_64-unknown-freebsd", - } + - { os_release: "15.0", target: "x86_64-unknown-freebsd" } + - { os_release: "14.3", target: "x86_64-unknown-freebsd" } + - { os_release: "13.5", target: "x86_64-unknown-freebsd" } steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -309,8 +297,8 @@ jobs: key: ${{ matrix.info.target }}-${{ matrix.info.os_release }} cache-all-crates: true - - name: Tests + Clippy (FreeBSD) - if: ${{ matrix.info.type == 'freebsd' }} + # The VM jobs randomly fail, and since GHA clearly never fails and doesn't know how to retry, we retry manually. + - name: FreeBSD Tests + Clippy (Attempt 1) uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4 with: release: "${{ matrix.info.os_release }}" @@ -325,6 +313,45 @@ jobs: # Note this only tests the default features, but I think that's fine. cargo test --no-fail-fast --locked -- --nocapture --quiet cargo clippy --all-targets --workspace -- -D warnings + id: upload_attempt_1 + continue-on-error: true + + - name: FreeBSD Tests + Clippy (Attempt 2) + uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4 + with: + release: "${{ matrix.info.os_release }}" + envs: "RUST_BACKTRACE CARGO_INCREMENTAL CARGO_PROFILE_DEV_DEBUG CARGO_HUSKY_DONT_INSTALL_HOOKS" + usesh: true + prepare: | + pkg install -y curl bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh + sh rustup.sh --default-toolchain stable -y + run: | + . "$HOME/.cargo/env" + # Note this only tests the default features, but I think that's fine. + cargo test --no-fail-fast --locked -- --nocapture --quiet + cargo clippy --all-targets --workspace -- -D warnings + if: steps.upload_attempt_1.outcome == 'failure' + id: upload_attempt_2 + continue-on-error: true + + - name: FreeBSD Tests + Clippy (Attempt 3) + uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4 + with: + release: "${{ matrix.info.os_release }}" + envs: "RUST_BACKTRACE CARGO_INCREMENTAL CARGO_PROFILE_DEV_DEBUG CARGO_HUSKY_DONT_INSTALL_HOOKS" + usesh: true + prepare: | + pkg install -y curl bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh + sh rustup.sh --default-toolchain stable -y + run: | + . "$HOME/.cargo/env" + # Note this only tests the default features, but I think that's fine. + cargo test --no-fail-fast --locked -- --nocapture --quiet + cargo clippy --all-targets --workspace -- -D warnings + if: steps.upload_attempt_2.outcome == 'failure' + id: upload_attempt_3 completion: name: "CI Pass Check" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f2ebcc96..5a771580 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -77,35 +77,35 @@ jobs: run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked --target=${{ matrix.info.target }} # The token is generally not needed, but sometimes the default shared token hits limits. - # Yes this is ugly as hell. Why this is not a built-in feature of GHA, I have no idea. + # Yes this is ugly as hell. Why retrying is not a built-in feature of GHA, I have no idea. + - name: Upload to codecov.io (Attempt 1) - id: upload_attempt_1 uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: files: lcov.info fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} flags: ${{ matrix.info.os }} + id: upload_attempt_1 continue-on-error: true - name: Upload to codecov.io (Attempt 2) - id: upload_attempt_2 - if: steps.upload_attempt_1.outcome == 'failure' uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: files: lcov.info fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} flags: ${{ matrix.info.os }} + if: steps.upload_attempt_1.outcome == 'failure' + id: upload_attempt_2 continue-on-error: true - name: Upload to codecov.io (Attempt 3) - id: upload_attempt_3 - if: steps.upload_attempt_2.outcome == 'failure' uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: files: lcov.info fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} flags: ${{ matrix.info.os }} - continue-on-error: true + if: steps.upload_attempt_2.outcome == 'failure' + id: upload_attempt_3