-
Notifications
You must be signed in to change notification settings - Fork 15
152 lines (130 loc) · 4.15 KB
/
build-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
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
name: Build and test
on:
push:
branches:
- main
- stable/*
- release-*
pull_request: { }
merge_group: { }
workflow_call: { }
concurrency:
cancel-in-progress: true
group: "${{ github.workflow }}-${{ github.ref }}"
defaults:
run:
# use bash shell by default to ensure pipefail behavior is the default
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash
jobs:
code-formatting:
name: check code formatting
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Check format
run: mvn spotless:check
- name: Check license
run: mvn license:check
build-and-test-embedded:
name: Run tests on ${{ matrix.os }}
timeout-minutes: 15
needs: code-formatting
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Build
id: build
run: mvn -B -U -pl "-:spring-boot-starter-camunda-test-testcontainer" -P !localBuild "-Dsurefire.rerunFailingTestsCount=5" clean install
- name: Archive Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: Unit Test Results ${{ matrix.os }}
path: "*/target/surefire-reports/"
retention-days: 7
build-and-test-testcontainers:
name: Run tests on ubuntu-latest using testcontainers
timeout-minutes: 15
needs: code-formatting
runs-on: ubuntu-latest
env:
IMAGE_NAME: "qa-tests"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Package
run: mvn -B -U -P !localBuild clean package -DskipTests
- name: Build engine docker container
run: |
cd engine-agent
docker build . -t ${{ env.IMAGE_NAME }}:${{ github.sha }}
- name: Update image tag in config
run: |
cd extension-testcontainer/src/main/resources
sed -i '/container.image.name=/ s/=.*/=${{ env.IMAGE_NAME }}/' config.properties
sed -i '/container.image.tag=/ s/=.*/=${{ github.sha }}/' config.properties
cat config.properties
env:
IMAGE_NAME_KEY: container.image.name
IMAGE_TAG_KEY: container.image.tag
- name: Build
id: build
run: |
mvn clean -B -U -pl ":zeebe-process-test-qa-testcontainers" -P !localBuild -am "-Dsurefire.rerunFailingTestsCount=5" install -DskipChecks
- name: Archive Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: Unit Test Results Testcontainers
path: "*/target/surefire-reports/"
retention-days: 7
test-summary:
# Check all tests, including the unit test matrix.
# New test jobs must be added to the `needs` lists!
name: Test summary
runs-on: ubuntu-latest
needs:
- code-formatting
- build-and-test-embedded
- build-and-test-testcontainers
steps:
- run: exit 0
# We need to upload the event file as an artifact in order to support publishing the results of
# forked repositories (https://github.com/EnricoMi/publish-unit-test-result-action#support-fork-repositories-and-dependabot-branches)
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
retention-days: 1