add changeset timeout #29
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: Run Pro build & tests | |
on: | |
workflow_call: | |
inputs: | |
latestMergeSha: | |
description: 'Latest Merge sha of OSS PR' | |
required: false | |
default: '' | |
type: string | |
thisBranchName: | |
description: 'Branch Name of OSS PR' | |
required: false | |
default: '' | |
type: string | |
pull_request: | |
types: [labeled] | |
jobs: | |
# build and test pro master branch using current branch to ensure nothing is being broken by this PR | |
run-pro-build: | |
name: Build & Test Pro | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'build&TestPro') || (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') | |
steps: | |
- name: Check variables | |
run: | | |
echo "github.event_name: ${{ github.event_name }}" | |
echo "github.event.pull_request.labels.*.name: ${{ contains(github.event.pull_request.labels.*.name, 'build&TestPro') }}" | |
echo "github.event.after: ${{ github.event.after }}" | |
echo "github.base_ref: ${{ github.base_ref }}" | |
echo "github.event.pull_request.merged: ${{ github.event.pull_request.merged }}" | |
echo "github.event_name: ${{ github.event_name }}" | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.event.after}} # get the sha of the commit or the new commit created when branch is merged to master | |
run-pro-build-and-tests: | |
runs-on: ubuntu-latest | |
needs: [run-pro-build ] | |
name: Trigger Functional Tests | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set environment variables for PR branch and SHA | |
run: | | |
if [ "${{ github.event_name }}" == "workflow_call" ]; then | |
echo "RUN_TESTS_BRANCH=${{ inputs.thisBranchName }}" >> $GITHUB_ENV | |
echo "RUN_TESTS_SHA=${{ inputs.latestMergeSha }}" >> $GITHUB_ENV | |
else | |
echo "RUN_TESTS_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | |
echo "RUN_TESTS_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV | |
fi | |
- name: Get OSS Workflow Run URL | |
id: get-workflow-url | |
run: | | |
repo_url="https://github.com/${{ github.repository }}" | |
ossWorkflowUrl="${repo_url}/actions/runs/${{ github.run_id }}" | |
echo "ossWorkflowUrl=${ossWorkflowUrl}" >> $GITHUB_ENV | |
- name: Dispatch an action and get the run ID | |
uses: codex-/return-dispatch@v2 | |
id: return_dispatch | |
with: | |
token: ${{ secrets.RUN_FUNCTIONAL_TEST_HARNESS_TESTS_TOKEN }} | |
ref: "master" | |
repo: liquibase-pro | |
owner: liquibase | |
workflow: build-and-test-from-oss.yml | |
workflow_inputs: | |
'{"liquibaseCommit": "${{ env.RUN_TESTS_SHA }}", | |
"runDescription": "${{ env.ossWorkflowUrl }}", | |
"liquibaseBranch": "${{ env.RUN_TESTS_BRANCH }}" | |
}' | |
- name: Display run ID and URL | |
run: | | |
echo ${{steps.return_dispatch.outputs.run_id}} | |
echo ${{steps.return_dispatch.outputs.run_url}} | |
- name: Report PRO Build & Tests Run URL | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const targetURL = "https://github.com/liquibase/liquibase-pro/actions/runs/${{ steps.return_dispatch.outputs.run_id }}" | |
core.notice("Pro Build & Tests Run URL: " + targetURL); |