merge validations #6
Workflow file for this run
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: merge validations | |
on: | |
pull_request: | |
branches: [ main ] | |
types: [ opened ] | |
issue_comment: | |
types: [ created ] | |
workflow_dispatch: | |
jobs: | |
setup_gha: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Determine Target Branch | |
id: determine-branch | |
run: | | |
echo "TARGET_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_BRANCH }} | |
- name: Comment on PR | |
if: ${{ github.event.action == 'opened' }} | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Thank you for contributing to the ops-terra-utils repo! \n A test suite will now begin running to ensure that no breaking changes are made.\n If these tests fail you can have them re-run after making changes by commenting `/run_tests`' | |
}) | |
E2E_linting_check: | |
# only run newly created PR or comment with /run_tests | |
runs-on: ubuntu-latest | |
needs: setup_gha | |
steps: | |
- name: clone branch of PR | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{github.event.pull_request.head.sha || github.sha}} | |
- name: remove comment whitespace | |
id: regex-match | |
uses: actions-ecosystem/action-regex-match@v2 | |
with: | |
text: ${{ github.event.comment.body }} | |
regex: '/(?<![\w\d])\/run_tests(?![\w\d])/gm' | |
- name: Perform linting checks | |
id: linting-check | |
if: ${{ github.event.action == 'opened' || steps.regex-match.outputs.match == '/run_tests' || 1 == 1 }} | |
uses: ./.github/actions/linting-check | |
- name: report status | |
uses: LouisBrunner/[email protected] | |
if: always() | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: E2E_linting_check | |
conclusion: ${{ job.status }} | |
sha: ${{github.event.pull_request.head.sha || github.sha}} | |
output: | | |
{"summary":"${{ steps.linting-check.outputs.summary }}"} | |
E2E_wdl_validation: | |
runs-on: ubuntu-latest | |
needs: E2E_linting_check | |
steps: | |
- name: Checkout PR Branch | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{github.event.pull_request.head.sha || github.sha}} | |
- name: find any changed wdl files | |
id: get_updated_wdls | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: 'wdl/**.wdl' | |
- name: run_wdl_validation | |
id: wdl-validation | |
if: steps.get_updated_wdls.outputs.any_changed == 'true' | |
uses: ./.github/workflows/validate_wdls.yaml | |
- name: report status | |
uses: LouisBrunner/[email protected] | |
if: always() | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: E2E_wdl_validation | |
conclusion: ${{ job.status }} | |
sha: ${{github.event.pull_request.head.sha || github.sha}} | |
output: | | |
{"summary":"${{ steps.wdl-validation.outputs.summary }}"} | |
E2E_integration_tests: | |
needs: E2E_linting_check | |
uses: ./.github/workflows/integration-tests.yaml | |
secrets: inherit |