forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 80
53 lines (51 loc) · 2.03 KB
/
integration_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Run Integration Tests
on:
workflow_dispatch:
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" }'