Skip to content

Commit

Permalink
chore(ci): move component features check out of merge queue (vectordo…
Browse files Browse the repository at this point in the history
…tdev#17773)

Moves the most costly (both $ and time) status check out of the merge
queue into a fixed schedule.
The workflow can still be run on demand by a PR comment, or from the GHA
UI.
  • Loading branch information
neuronull committed Jun 29, 2023
1 parent f79947c commit e6e776d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/component_features.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
# 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:
runs-on: [linux, ubuntu-20.04-8core]
# 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
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'
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 }}
context: Component Features - Linux
status: pending

- name: (PR comment) Checkout PR branch
if: ${{ github.event_name == 'issue_comment' }}
if: github.event_name == 'issue_comment'
uses: actions/checkout@v3
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}

- name: Checkout branch
if: ${{ github.event_name != 'issue_comment' }}
if: github.event_name != 'issue_comment'
uses: actions/checkout@v3

- run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh
Expand All @@ -37,8 +52,8 @@ jobs:
- run: make check-component-features

- 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'
uses: myrotvorets/set-commit-status-action@v1.1.7
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/master_merge_queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -117,7 +111,6 @@ jobs:
- test-misc
- test-environment
- check-msrv
- check-component-features
- cross-linux
- unit-mac
- unit-windows
Expand Down

0 comments on commit e6e776d

Please sign in to comment.