-
Notifications
You must be signed in to change notification settings - Fork 67
228 lines (205 loc) · 7.62 KB
/
End2EndTest.yml
File metadata and controls
228 lines (205 loc) · 7.62 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# Name of the GitHub Actions workflow
name: Snowpipe Java SDK
# Controls when the workflow will run
on:
push:
branches: [ master ]
paths-ignore:
- '.claude/**'
pull_request:
branches: [ '**' ]
paths-ignore:
- '.claude/**'
jobs:
# Detect whether any non-.claude files changed; all build jobs are gated on this
check-changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- '**'
- '!.claude/**'
# Job for building and testing on Ubuntu
build:
needs: [check-changes]
if: needs.check-changes.outputs.src == 'true'
name: Build & Test - JDK ${{ matrix.java }}, Cloud ${{ matrix.snowflake_cloud }}
# Use a stable LTS version of Ubuntu runner
runs-on: ubuntu-22.04
strategy:
# Don't cancel other jobs in the matrix if one fails
fail-fast: false
matrix:
java: [ 8 ]
snowflake_cloud: [ 'AWS', 'AZURE', 'GCP' ]
steps:
# Use the latest stable version of the checkout action (v4)
- name: Checkout Code
uses: actions/checkout@v4
# Use the latest stable version of the setup-java action (v4)
- name: Install Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
# Enable caching of Maven dependencies to speed up builds
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Decrypt profile.json for Cloud ${{ matrix.snowflake_cloud }}
env:
DECRYPTION_PASSPHRASE: ${{ secrets.PROFILE_JSON_DECRYPT_PASSPHRASE }}
run: |
./scripts/decrypt_secret.sh ${{ matrix.snowflake_cloud }}
- name: Unit & Integration Test against Cloud ${{ matrix.snowflake_cloud }}
env:
JACOCO_COVERAGE: true
WHITESOURCE_API_KEY: ${{ secrets.WHITESOURCE_API_KEY }}
continue-on-error: false
run: |
./scripts/run_gh_actions.sh -Dfailsafe.excludedGroups="net.snowflake.ingest.IcebergIT"
# Use the latest stable version of the codecov action (v4)
- name: Code Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Job for building and testing on Windows
build-windows:
needs: [check-changes]
if: needs.check-changes.outputs.src == 'true'
name: Build & Test - Windows, JDK ${{ matrix.java }}, Cloud ${{ matrix.snowflake_cloud }}
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
java: [ 8 ]
snowflake_cloud: [ 'AWS', 'AZURE', 'GCP' ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Decrypt profile.json for Cloud ${{ matrix.snowflake_cloud }} on Windows Powershell
env:
DECRYPTION_PASSPHRASE: ${{ secrets.PROFILE_JSON_DECRYPT_PASSPHRASE }}
shell: pwsh
run: |
./scripts/decrypt_secret_windows.ps1 -SnowflakeDeployment '${{ matrix.snowflake_cloud }}'
- name: Unit & Integration Test (Windows)
continue-on-error: false
run: |
mvn -DghActionsIT -Dnot-shadeDep -D"failsafe.excludedGroups"="net.snowflake.ingest.IcebergIT" verify --batch-mode
# Job for building and testing Iceberg functionality on Ubuntu
build-iceberg:
needs: [check-changes]
if: needs.check-changes.outputs.src == 'true'
name: Build & Test Streaming Iceberg - JDK ${{ matrix.java }}, Cloud ${{ matrix.snowflake_cloud }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java: [ 8 ]
snowflake_cloud: [ 'AWS', 'AZURE' ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Decrypt profile.json for Cloud ${{ matrix.snowflake_cloud }}
env:
DECRYPTION_PASSPHRASE: ${{ secrets.PROFILE_JSON_DECRYPT_PASSPHRASE }}
run: |
./scripts/decrypt_secret.sh ${{ matrix.snowflake_cloud }}
- name: Unit & Integration Test against Cloud ${{ matrix.snowflake_cloud }}
env:
JACOCO_COVERAGE: true
WHITESOURCE_API_KEY: ${{ secrets.WHITESOURCE_API_KEY }}
continue-on-error: false
run: |
./scripts/run_gh_actions.sh -Dfailsafe.groups="net.snowflake.ingest.IcebergIT"
- name: Code Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Job for building and testing Iceberg functionality on Windows
build-iceberg-windows:
needs: [check-changes]
if: needs.check-changes.outputs.src == 'true'
name: Build & Test - Streaming Iceberg Windows, JDK ${{ matrix.java }}, Cloud ${{ matrix.snowflake_cloud }}
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
java: [ 8 ]
snowflake_cloud: [ 'AWS', 'AZURE' ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Decrypt profile.json for Cloud ${{ matrix.snowflake_cloud }} on Windows Powershell
env:
DECRYPTION_PASSPHRASE: ${{ secrets.PROFILE_JSON_DECRYPT_PASSPHRASE }}
shell: pwsh
run: |
./scripts/decrypt_secret_windows.ps1 -SnowflakeDeployment '${{ matrix.snowflake_cloud }}'
- name: Unit & Integration Test (Windows)
continue-on-error: false
run: |
mvn -DghActionsIT -Dnot-shadeDep -"Dfailsafe.groups"="net.snowflake.ingest.IcebergIT" verify --batch-mode
# Job for end-to-end testing with different JAR types and Java versions
build-e2e-jar-test:
needs: [check-changes]
if: needs.check-changes.outputs.src == 'true'
name: e2e-jar-test cloud=${{ matrix.snowflake_cloud }} test_type=${{ matrix.test_type }} java=${{ matrix.java_path_env_var }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
snowflake_cloud: [ 'AWS', 'AZURE', 'GCP' ]
test_type: [ 'shaded', 'unshaded', 'fips' ]
java_path_env_var: [ "JAVA_HOME_8_X64", "JAVA_HOME_11_X64", "JAVA_HOME_17_X64", "JAVA_HOME_21_X64" ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
# Install all required LTS java versions
java-version: |
21
17
11
8
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Decrypt profile.json for Cloud ${{ matrix.snowflake_cloud }}
env:
DECRYPTION_PASSPHRASE: ${{ secrets.PROFILE_JSON_DECRYPT_PASSPHRASE }}
run: ./scripts/decrypt_secret.sh ${{ matrix.snowflake_cloud }}
- name: Run E2E JAR Test
env:
test_type: ${{ matrix.test_type }}
java_path_env_var: ${{ matrix.java_path_env_var }}
run: ./e2e-jar-test/run_e2e_jar_test.sh