-
Notifications
You must be signed in to change notification settings - Fork 11
97 lines (95 loc) · 2.79 KB
/
build-and-test.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Compile
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: compileTestKotlin
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: Upload test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports
path: ./build/reports/tests
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: ./build/test-results
build-check:
runs-on: ubuntu-latest
needs: build
steps:
- run: echo "All build jobs successful."
test-integration:
runs-on: ubuntu-latest
needs: build-check
env:
JIRA_LICENSE: '${{ secrets.JIRA_LICENSE }}'
TERM: dumb
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare Jira license
run: echo $JIRA_LICENSE > jira-license.txt
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 14400
- name: Generate workflow URL
run: echo "WORKFLOW_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Test integration
uses: gradle/gradle-build-action@v2
continue-on-error: true # expect it to sometimes flake
with:
gradle-version: wrapper
arguments: testIntegration
env:
USER: ${{ env.WORKFLOW_URL }}
- name: Test integration # if the last run was green, this should be quick, expect the rerun to be green
uses: gradle/gradle-build-action@v2
with:
arguments: testIntegration
env:
USER: ${{ env.WORKFLOW_URL }}
- name: Upload test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports
path: ./build/reports/tests
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: ./build/test-results