Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .github/workflows/component_features.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,65 @@
# 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]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a ternary operator here to consolidate the jobs? It looks like this should work from reading the documentation but I'm not positive.

Suggested change
runs-on: [linux, ubuntu-20.04-8core]
runs-on: ${{ github.event_name == 'schedule' && 'ubuntu-latest' || fromJSON('["linux", "ubuntu-20.04-8core"]') }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮 I tried that in the playground and it worked, that's pretty awesome. I didn't realize that you could use expression syntax outside of if conditionals.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}
submodules: "recursive"

- name: Checkout branch
if: ${{ github.event_name != 'issue_comment' }}
if: github.event_name != 'issue_comment'
uses: actions/checkout@v3
with:
submodules: "recursive"
Expand All @@ -40,8 +70,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