-
Notifications
You must be signed in to change notification settings - Fork 14
125 lines (118 loc) · 4.72 KB
/
test-dataflow.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
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
name: Test (Google Dataflow)
on:
push:
workflow_dispatch:
jobs:
dupe_check:
name: Check for Duplicate Workflow Run
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v3.4.0
with:
concurrent_skipping: same_content
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
build:
name: Integration Tests
needs:
- dupe_check
if: needs.dupe_check.outputs.should_skip != 'true' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
strategy:
matrix:
beam-version: [ "", "2.20.0", "2.25.0" ]
experiments: [ "", "use_sdf_read", "use_deprecated_read" ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-test-dataflow-${{ matrix.beam-version }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-test-dataflow-${{ matrix.beam-version }}-
- name: Setup JDK 8
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
- name: Setup GCP SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Install Test Support
run: mvn clean install -f solace-integration-test-support/ -DskipTests
- name: Select Test Suite
id: test-suite-selector
run: |
if [[ -n "${{ matrix.beam-version }}" ]]; then
if [[ "${{ github.event_name }}" != 'push' ]] || [[ "${{ github.ref }}" =~ ^refs\/(heads\/master|tags\/.+)$ ]]; then
echo 'Will run expanded minimal test suite'
echo "::set-output name=it-tests::${EMIN_TEST_SUITE}"
else
echo 'Will run minimal test suite'
echo "::set-output name=it-tests::${MIN_TEST_SUITE}"
fi
elif [[ "${{ github.event_name }}" == 'push' ]] && [[ "${{ github.ref }}" == refs/heads/* ]] && [[ "${{ github.ref }}" != 'refs/heads/master' ]]; then
echo 'Will run minimal test suite'
echo "::set-output name=it-tests::${MIN_TEST_SUITE}"
else
echo 'Will run full test suite'
fi
env:
MIN_TEST_SUITE: SolaceIOIT#testBasic,SolaceRecordTestIT#testBasic
EMIN_TEST_SUITE: SolaceIOIT#testBasic,SolaceRecordTestIT#testBasic,*DataflowIT
- name: Build and Run Tests
run: >-
mvn clean verify
${{ matrix.beam-version && format('-Dbeam.version={0}', matrix.beam-version) || '' }}
${{ steps.test-suite-selector.outputs.it-tests && format('-Dit.test={0}', steps.test-suite-selector.outputs.it-tests) || '' }}
"-DbeamTestPipelineOptions=[
\"--runner=TestDataflowRunner\",
\"--experiments=${{ matrix.experiments }}\",
\"--tempRoot=${{ secrets.GCP_DATAFLOW_TEMP_ROOT }}\",
\"--pspHost=${{ secrets.SOLACE_HOST }}\",
\"--pspUsername=${{ secrets.SOLACE_USERNAME }}\",
\"--pspPassword=${{ secrets.SOLACE_PASSWORD }}\",
\"--pspVpnName=${{ secrets.SOLACE_VPN_NAME }}\",
\"--pspMgmtHost=${{ secrets.SOLACE_MGMT_HOST }}\",
\"--pspMgmtUsername=${{ secrets.SOLACE_MGMT_USERNAME }}\",
\"--pspMgmtPassword=${{ secrets.SOLACE_MGMT_PASSWORD }}\"
]"
- name: Upload Test Artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results (${{ matrix.beam-version }}, ${{ matrix.experiments }})
path: |
**/target/failsafe-reports/*.xml
**/target/surefire-reports/*.xml
publish-test-results:
name: Publish Test Results
needs:
- build
if: success() || failure()
runs-on: ubuntu-latest
steps:
- name: Download Test Results
uses: actions/download-artifact@v2
with:
path: test-artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
continue-on-error: true
with:
check_name: Unit Test Results (Dataflow)
comment_mode: create new
fail_on: nothing
hide_comments: orphaned commits
files: |
test-artifacts/**/failsafe-reports/**/*.xml
!test-artifacts/**/failsafe-reports/**/failsafe-summary.xml
test-artifacts/**/surefire-reports/**/*.xml