-
Notifications
You must be signed in to change notification settings - Fork 315
142 lines (139 loc) · 4.39 KB
/
NativeTests.yaml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: NativeTests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'spring-cloud-generator/**'
- 'spring-cloud-previews/**'
workflow_dispatch:
jobs:
NativeTests:
if: |
github.actor != 'dependabot[bot]' && ((
github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name
) || (github.event_name != 'pull_request'))
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d' --utc)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Set Up Authentication
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.SPRING_CLOUD_GCP_CI_NATIVE_SA_KEY }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
with:
project_id: spring-cloud-gcp-ci-native
- name: Maven go offline
id: mvn-offline
if: steps.mvn-cache.outputs.cache-hit != 'true'
run: ./mvnw compile dependency:go-offline
- name: Mvn install # Need this when the directory/pom structure changes
id: install1
continue-on-error: true
run: |
./mvnw \
--batch-mode \
--threads 1.5C \
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
install
- name: Retry install on failure
id: install2
if: steps.install1.outcome == 'failure'
run: |
./mvnw \
--batch-mode \
--threads 1.5C \
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
install
- name: Wait our turn for running native tests
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
continue-after-seconds: 3600 # 60 min
same-branch-only: false
- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.2'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Native Tests in Samples
id: intTest1
continue-on-error: true
run: |
../mvnw \
--batch-mode \
--activate-profiles native-sample-config,nativeTest \
--define notAllModules=true \
--define maven.javadoc.skip=true \
test
working-directory: ./spring-cloud-gcp-samples
- name: Retry on Failure
id: intTest2
if: steps.intTest1.outcome == 'failure'
run: |
../mvnw \
--batch-mode \
--activate-profiles native-sample-config,nativeTest \
--define notAllModules=true \
--define maven.javadoc.skip=true \
test
working-directory: ./spring-cloud-gcp-samples
- name: Aggregate Report
run: |
../mvnw \
--batch-mode \
--define aggregate=true \
--activate-profiles native-sample-config \
surefire-report:report-only
working-directory: ./spring-cloud-gcp-samples
- name: Native Tests in Modules
id: intTest3
continue-on-error: true
run: |
./mvnw \
--batch-mode \
--activate-profiles spring-native,\!default \
--define maven.javadoc.skip=true \
test
- name: Retry on Failure
id: intTest4
if: steps.intTest3.outcome == 'failure'
run: |
./mvnw \
--batch-mode \
--activate-profiles spring-native,\!default \
--define maven.javadoc.skip=true \
test
- name: Aggregate Report
run: |
./mvnw \
--batch-mode \
--define aggregate=true \
--activate-profiles spring-native,\!default \
surefire-report:report-only
- name: Archive logs
if: always()
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: Native Test Logs
path: |
**/target/failsafe-reports/*
**/target/site