name: Run Integration Tests
on:
  workflow_run:
    workflows: ["AndroidX Presubmits"]
    types: [completed]

jobs:
  run_integration_tests:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    name: Run integration tests on FTL
    steps:
      - name: Set up JDK 11
        uses: actions/setup-java@v2
        with:
          java-version: '11'
          distribution: 'adopt'
      - name: "set output directory"
        run: echo "::set-output name=output-dir::$(readlink -f .)/outputs"
        id: dirs
      - id: run_tests
        uses: androidX/androidx-ci-action@latest
        with:
          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 }}

Add workflow to run integration tests
Add workflow to run integration tests

This CL adds a new workflow to run integration tests via the new
androidx-ci-action.

I've not removed the FTL step from the main build file yet and will do
so once we fully migrate to androidx-ci-action. Unfortunately, post
workflow trigger works only on the main branch hence we need this
workflow file to run end-to-end test on production.

Bug: n/a
Test: https://github.com/androidx/androidx/actions/runs/851468271
Change-Id: I1f9fa96ef36dab900c2242527bb47983622cb5ee
