Skip to content

Commit

Permalink
Update treadmill-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lschuermann authored Oct 21, 2024
1 parent cc310ab commit 6e31cfb
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions .github/workflows/treadmill-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,23 @@ name: treadmill-ci
env:
TERM: xterm # Makes tput work in actions output

# Controls when the action will run. Triggers the workflow on pull request and
# merge group checks:
#
# KEEP IN SYNC WITH `environment:` ATTRIBUTE BELOW:
on:
push:
branches:
- master
- dev/tock-hardware-ci
# Pull requests from forks will not have access to the required GitHub API
# secrets below, even if they are using an appropriate deployment environment
# and the workflow runs have been approved according to this environment's
# rules. We don't know whether this is a bug on GitHub's end or deliberate.
# Either way, for now we disable this workflow to run on PRs until we have
# an API proxy that securely performs these GitHub API calls (adding runners
# and starting Treadmill jobs with those runner registration tokens), which
# allows this workflow to run without access to repository secrets.
#pull_request:
merge_group: # Run CI for the GitHub merge queue

permissions:
contents: read
workflow_call:
inputs:
environment:
required: true
type: string
repository:
required: true
type: string

jobs:
test-prepare:
runs-on: ubuntu-latest

# Do not run job on forks, as they will not have the correct environment set up
if: github.repository == 'tock/tock-hardware-ci'

# This provides access to the secrets required below:
# - for `treadmill-ci`: after approval by certain persons or GH teams
# - for `treadmill-ci-merged`: without approval, on merge queue branches
# and the master branch
#
# KEEP IN SYNC WITH `on:` EVENTS ABOVE:
environment: ${{ github.event_name == 'pull_request' && 'treadmill-ci' || 'treadmill-ci-merged' }}
if: github.repository == inputs.repository
environment: ${{ inputs.environment }}

outputs:
tml-job-ids: ${{ steps.treadmill-job-launch.outputs.tml-job-ids }}
Expand Down

0 comments on commit 6e31cfb

Please sign in to comment.