RunTestForArchitecture #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OnSafeToTestLabel | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
pull_request_target: | |
types: [ labeled ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
run-for-x86: | |
if: ${{ (contains(github.event.pull_request.labels.*.name, 'safe to test') && !contains(github.event.pull_request.labels.*.name, 'lgtm')) || (contains(github.event_name, 'workflow_dispatch')) }} | |
uses: './.github/workflows/test-plugin.yml' | |
with: | |
architecture: 'x86_64' | |
ec2-image-type: 't3.medium' | |
run-for-arm: | |
if: ${{ (contains(github.event.pull_request.labels.*.name, 'safe to test') && !contains(github.event.pull_request.labels.*.name, 'lgtm')) || (contains(github.event_name, 'workflow_dispatch')) }} | |
uses: './.github/workflows/test-plugin.yml' | |
with: | |
architecture: 'arm' | |
ec2-image-type: 't4g.medium' | |
needs: run-for-x86 | |
remove-safe-to-test: | |
name: Remove Safe to Test Label | |
needs: run-for-arm | |
runs-on: ubuntu-latest | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'safe to test') && !contains(github.event.pull_request.labels.*.name, 'lgtm') && always() }} # required to stop the runner even if the error happened in the previous jobs | |
steps: | |
- name: Remove Label | |
uses: divyansh-gupta/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 | |
with: | |
labels: | |
'safe to test' | |
#We want to make this false because if we run into some edge case | |
#we don't want to fail out. Worst case | |
#the label stays and we remove/re-add. | |
fail_on_error: 'false' |