Run Integration Tests #263
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 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 "output-dir=$(readlink -f .)/outputs" >> $GITHUB_OUTPUT | |
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 }} | |
gcp-bucket-name: "androidx-ftl-test-results" | |
gcp-bucket-path: "github-ci-action" | |
log-file: ${{ steps.dirs.outputs.output-dir }}/ftl-logs.txt | |
device-specs: Pixel2.arm:30 | |
use-test-config-files: true | |
test-suite-tags: androidx_unit_tests | |
- 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 "result=true" >> $GITHUB_OUTPUT | |
else | |
echo "result=false" >> GITHUB_OUTPUT | |
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" }' |