From b0c97d11e758554c45cd4d23d0a74e64a17ccc78 Mon Sep 17 00:00:00 2001 From: neuronull Date: Tue, 27 Jun 2023 14:23:40 -0600 Subject: [PATCH 1/4] chore(ci): move component features check out of merge queue --- .github/workflows/component_features.yml | 42 +++++++++++++++++------- .github/workflows/master_merge_queue.yml | 7 ---- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/component_features.yml b/.github/workflows/component_features.yml index a888fe6c83d05..d903a33bcac04 100644 --- a/.github/workflows/component_features.yml +++ b/.github/workflows/component_features.yml @@ -1,20 +1,48 @@ +# Component Features - Linux +# +# Validates that each component feature compiles +# +# Runs on: +# - scheduled UTC midnight Tues-Sat +# - on PR comment (see comment-trigger.yml) +# - on demand from github actions UI + name: Component Features - Linux on: workflow_call: + workflow_dispatch: + schedule: + # At midnight UTC Tue-Sat + - cron: '0 0 * * 2-6' jobs: - check-component-features: + check-component-features-schedule: + # use free tier on the schedule + runs-on: ubuntu-latest + if: github.event_name == 'schedule' + steps: + - name: Checkout branch + uses: actions/checkout@v3 + with: + submodules: "recursive" + + - run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh + - run: bash scripts/environment/prepare.sh + - run: echo "::add-matcher::.github/matchers/rust.json" + - run: make check-component-features + + check-component-features-comment: + # expedite results when running on demand runs-on: [linux, ubuntu-20.04-8core] + if: github.event_name == 'issue_comment' || github.event_name == 'workflow_dispatch' steps: - name: (PR comment) Get PR branch - if: ${{ github.event_name == 'issue_comment' }} uses: xt0rted/pull-request-comment-branch@v2 id: comment-branch - name: (PR comment) Set latest commit status as pending uses: myrotvorets/set-commit-status-action@v1.1.7 - if: ${{ github.event_name == 'issue_comment' }} with: sha: ${{ steps.comment-branch.outputs.head_sha }} token: ${{ secrets.GITHUB_TOKEN }} @@ -22,18 +50,11 @@ jobs: status: pending - name: (PR comment) Checkout PR branch - if: ${{ github.event_name == 'issue_comment' }} uses: actions/checkout@v3 with: ref: ${{ steps.comment-branch.outputs.head_ref }} submodules: "recursive" - - name: Checkout branch - if: ${{ github.event_name != 'issue_comment' }} - uses: actions/checkout@v3 - with: - submodules: "recursive" - - run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh - run: bash scripts/environment/prepare.sh - run: echo "::add-matcher::.github/matchers/rust.json" @@ -41,7 +62,6 @@ jobs: - name: (PR comment) Set latest commit status as ${{ job.status }} uses: myrotvorets/set-commit-status-action@v1.1.7 - if: always() && github.event_name == 'issue_comment' with: sha: ${{ steps.comment-branch.outputs.head_sha }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/master_merge_queue.yml b/.github/workflows/master_merge_queue.yml index eaf5b7bf08295..63b0a8805a2dd 100644 --- a/.github/workflows/master_merge_queue.yml +++ b/.github/workflows/master_merge_queue.yml @@ -74,12 +74,6 @@ jobs: needs: changes secrets: inherit - check-component-features: - if: needs.changes.outputs.source == 'true' - uses: ./.github/workflows/component_features.yml - needs: changes - secrets: inherit - cross-linux: # We run cross checks when dependencies change to ensure they still build. # This helps us avoid adopting dependencies that aren't compatible with other architectures. @@ -117,7 +111,6 @@ jobs: - test-misc - test-environment - check-msrv - - check-component-features - cross-linux - unit-mac - unit-windows From 37425046ab8ee7a91dc8440e5439ee34631970de Mon Sep 17 00:00:00 2001 From: neuronull Date: Tue, 27 Jun 2023 14:25:44 -0600 Subject: [PATCH 2/4] add back issue comment check --- .github/workflows/component_features.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/component_features.yml b/.github/workflows/component_features.yml index d903a33bcac04..baaca68d9500a 100644 --- a/.github/workflows/component_features.yml +++ b/.github/workflows/component_features.yml @@ -38,10 +38,12 @@ jobs: if: github.event_name == 'issue_comment' || github.event_name == 'workflow_dispatch' steps: - name: (PR comment) Get PR branch + if: ${{ github.event_name == 'issue_comment' }} uses: xt0rted/pull-request-comment-branch@v2 id: comment-branch - name: (PR comment) Set latest commit status as pending + if: ${{ github.event_name == 'issue_comment' }} uses: myrotvorets/set-commit-status-action@v1.1.7 with: sha: ${{ steps.comment-branch.outputs.head_sha }} @@ -61,6 +63,7 @@ jobs: - run: make check-component-features - name: (PR comment) Set latest commit status as ${{ job.status }} + if: ${{ github.event_name == 'issue_comment' }} uses: myrotvorets/set-commit-status-action@v1.1.7 with: sha: ${{ steps.comment-branch.outputs.head_sha }} From e90ff0d3534c64cbe514e6ba4b0c37a0cf18a1c2 Mon Sep 17 00:00:00 2001 From: neuronull Date: Tue, 27 Jun 2023 14:27:57 -0600 Subject: [PATCH 3/4] fixup logic --- .github/workflows/component_features.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/component_features.yml b/.github/workflows/component_features.yml index baaca68d9500a..1e71538353f94 100644 --- a/.github/workflows/component_features.yml +++ b/.github/workflows/component_features.yml @@ -38,12 +38,12 @@ jobs: if: github.event_name == 'issue_comment' || github.event_name == 'workflow_dispatch' steps: - name: (PR comment) Get PR branch - if: ${{ github.event_name == 'issue_comment' }} + if: github.event_name == 'issue_comment' uses: xt0rted/pull-request-comment-branch@v2 id: comment-branch - name: (PR comment) Set latest commit status as pending - if: ${{ github.event_name == 'issue_comment' }} + if: github.event_name == 'issue_comment' uses: myrotvorets/set-commit-status-action@v1.1.7 with: sha: ${{ steps.comment-branch.outputs.head_sha }} @@ -52,18 +52,25 @@ jobs: status: pending - name: (PR comment) Checkout PR branch + if: github.event_name == 'issue_comment' uses: actions/checkout@v3 with: ref: ${{ steps.comment-branch.outputs.head_ref }} submodules: "recursive" + - name: Checkout branch + if: github.event_name != 'issue_comment' + uses: actions/checkout@v3 + with: + submodules: "recursive" + - run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh - run: bash scripts/environment/prepare.sh - run: echo "::add-matcher::.github/matchers/rust.json" - run: make check-component-features - name: (PR comment) Set latest commit status as ${{ job.status }} - if: ${{ github.event_name == 'issue_comment' }} + if: always() && github.event_name == 'issue_comment' uses: myrotvorets/set-commit-status-action@v1.1.7 with: sha: ${{ steps.comment-branch.outputs.head_sha }} From e472e26ab457b79549359615826b78beaa70699c Mon Sep 17 00:00:00 2001 From: neuronull Date: Wed, 28 Jun 2023 10:38:48 -0600 Subject: [PATCH 4/4] feedback ds: combine jobs --- .github/workflows/component_features.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/component_features.yml b/.github/workflows/component_features.yml index 1e71538353f94..8659028dae173 100644 --- a/.github/workflows/component_features.yml +++ b/.github/workflows/component_features.yml @@ -17,24 +17,9 @@ on: - cron: '0 0 * * 2-6' jobs: - check-component-features-schedule: - # use free tier on the schedule - runs-on: ubuntu-latest - if: github.event_name == 'schedule' - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - submodules: "recursive" - - - run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh - - run: bash scripts/environment/prepare.sh - - run: echo "::add-matcher::.github/matchers/rust.json" - - run: make check-component-features - - check-component-features-comment: - # expedite results when running on demand - runs-on: [linux, ubuntu-20.04-8core] + check-component-features: + # use free tier on schedule and 8 core to expedite results on demand invocation + runs-on: ${{ github.event_name == 'schedule' && 'ubuntu-latest' || fromJSON('["linux", "ubuntu-20.04-8core"]') }} if: github.event_name == 'issue_comment' || github.event_name == 'workflow_dispatch' steps: - name: (PR comment) Get PR branch