blob: db2e46aa12df09b8352617ae2f80502c57f323f6 [file] [log] [blame]
name: Run Integration Tests
on:
workflow_run:
workflows: ["AndroidX Presubmits"]
types: [completed]
jobs:
run_integration_tests:
runs-on: ubuntu-latest
if: ${{ !github.event.repository.fork && github.event.workflow_run.conclusion == 'success' }}
name: Run integration tests on FTL
steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: "set output directory"
run: echo "::set-output name=output-dir::$(readlink -f .)/outputs"
id: dirs
- id: run_tests
uses: androidX/androidx-ci-action@dist-latest
with:
target-run-id: ${{ github.event.workflow_run.id }}
gcp-token: ${{ secrets.GCP_SA_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
output-folder: ${{ steps.dirs.outputs.output-dir }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: outputs
path: ${{ steps.dirs.outputs.output-dir }}
teardown:
runs-on: ubuntu-latest
needs: [run_integration_tests]
if: ${{ !github.event.repository.fork && always() }} # always() is required so that this job will run irrespective of status of upstream 'run_integration_test' job.
steps:
- name: Parse workflow status
id: workflow-status
run: |
set -x
if [ "${{ needs.run_integration_tests.result }}" == "success" ] && \
[ "${{ github.event.workflow_run.conclusion }}" == "success" ]
then
echo "::set-output name=result::true"
else
echo "::set-output name=result::false"
fi
- name: Result WebHook
uses: androidx/github-workflow-webhook-action@main
with:
url: 'https://androidx.dev/github/androidX/presubmit/hook'
secret: ${{ secrets.ANDROIDX_PRESUBMIT_HOOK_SECRET }}
payload: '{ "platform": "all", "token": "${{ secrets.GITHUB_TOKEN }}", "state": "completed", "success": ${{ steps.workflow-status.outputs.result }}, "src" : "workflow_run" }'