From 6c42770b5e0e77d693798425b5366b123362e863 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:08:01 -0400 Subject: [PATCH] ci: fix a few actions (#1583) A few small things: - Tweak timeouts - Disable audit workflow as codecov mostly handles it now - Fix mock check in nightly --- .github/workflows/audit.yml | 35 -------------------------- .github/workflows/build_releases.yml | 37 ++++++---------------------- .github/workflows/ci.yml | 8 +++--- .github/workflows/coverage.yml | 2 +- .github/workflows/nightly.yml | 3 +-- 5 files changed, 14 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/audit.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index 90debacb..00000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,35 +0,0 @@ -# A routine check to see if there are any Rust-specific security vulnerabilities in the repo we should be aware of. - -name: audit -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * 1" -jobs: - audit: - timeout-minutes: 18 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Set up Rust toolchain - uses: dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17 - with: - toolchain: stable - - - name: Enable Rust cache - uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 # 2.7.3 - with: - cache-targets: false - cache-all-crates: true - cache-on-failure: true - - - name: Install cargo-audit - run: | - cargo install cargo-audit --locked - rm -rf ~/.cargo/registry || echo "no registry to delete" - - - uses: rustsec/audit-check@dd51754d4e59da7395a4cd9b593f0ff2d61a9b95 # v1.4.1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index 63accc96..05f7e498 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -38,13 +38,15 @@ jobs: name: "Build binaries" runs-on: ${{ matrix.info.os }} container: ${{ matrix.info.container }} - timeout-minutes: 30 + timeout-minutes: 10 strategy: fail-fast: false matrix: info: # ======= Supported targets ======= # Linux (x86-64, x86, aarch64) + # + # TODO: In the future, when ARM runners are available on github, switch ARM targets off of cross. - { os: "ubuntu-20.04", target: "x86_64-unknown-linux-gnu", @@ -228,7 +230,7 @@ jobs: build-msi: name: "Build MSI installer" runs-on: "windows-2019" - timeout-minutes: 30 + timeout-minutes: 10 steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -276,34 +278,10 @@ jobs: name: "release-build-msi" path: release - # build-vm: - # name: "Build using VMs" - # runs-on: "ubuntu-latest" - # timeout-minutes: 30 - # strategy: - # fail-fast: false - # matrix: - # info: - # - { - # type: "freebsd", - # os_release: "14.1", - # target: "x86_64-unknown-freebsd", - # } - # - { - # type: "freebsd", - # os_release: "13.3", - # target: "x86_64-unknown-freebsd", - # } - # steps: - # - name: Checkout repository - # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - # with: - # fetch-depth: 1 - build-cirrus: name: "Build using Cirrus CI" runs-on: "ubuntu-latest" - timeout-minutes: 30 + timeout-minutes: 10 steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -341,10 +319,11 @@ jobs: build-deb: name: "Build .deb software packages" runs-on: "ubuntu-20.04" - timeout-minutes: 30 + timeout-minutes: 10 strategy: fail-fast: false matrix: + # TODO: In the future, when ARM runners are available on github, switch ARM targets off of cross. info: - { target: "x86_64-unknown-linux-gnu", dpkg: amd64 } - { target: "x86_64-unknown-linux-musl", cross: true, dpkg: amd64 } @@ -469,7 +448,7 @@ jobs: name: "Build .rpm software packages" runs-on: ubuntu-latest container: ghcr.io/clementtsang/almalinux-8 - timeout-minutes: 30 + timeout-minutes: 10 strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fada5a44..9aec7985 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,12 +57,12 @@ jobs: # Runs rustfmt + tests + clippy on the main supported platforms. # - # Note that m1 macOS is tested via CirrusCI. + # TODO: In the future, when ARM runners are available on github, switch ARM targets off of cross. supported: needs: pre-job if: ${{ needs.pre-job.outputs.should_skip != 'true' }} runs-on: ${{ matrix.info.os }} - timeout-minutes: 18 + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -143,7 +143,7 @@ jobs: needs: pre-job runs-on: ${{ matrix.info.os }} if: ${{ needs.pre-job.outputs.should_skip != 'true' }} - timeout-minutes: 20 + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -292,7 +292,7 @@ jobs: name: "Test using VMs" needs: pre-job runs-on: "ubuntu-latest" - timeout-minutes: 30 + timeout-minutes: 15 strategy: fail-fast: false matrix: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9309f97b..5fee6466 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -37,7 +37,7 @@ jobs: needs: pre-job if: ${{ needs.pre-job.outputs.should_skip != 'true' }} runs-on: ${{ matrix.info.os }} - timeout-minutes: 18 + timeout-minutes: 10 strategy: fail-fast: false matrix: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e922ba55..be98c549 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -41,10 +41,9 @@ jobs: steps: - name: Check if mock run: | - echo "${{ github.event.inputs.isMock }}"; if [[ -z "${{ github.event.inputs.isMock }}" ]]; then echo "This is a scheduled nightly run." - elif [[ ${{ github.event.inputs.isMock }} == true ]]; then + elif [[ "${{ github.event.inputs.isMock }}" == true ]]; then echo "This is a mock run." else echo "This is NOT a mock run. Watch for the generated files!"