-
Notifications
You must be signed in to change notification settings - Fork 16
136 lines (120 loc) · 3.77 KB
/
ci-test.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
name: CI - Build and tests
on:
pull_request:
branches:
- main
jobs:
build-and-unit-test:
name: Build and test
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Check license headers
run: mvn license:check
- name: Build
run: mvn -B -T 1C -ntp -nsu install -DskipTests
- name: Check CRDs and doc up-to-date
run: |
#!/bin/bash
./src/generate-crds-docs.sh
if [[ `git status --porcelain` ]]; then
echo "Found files changed after building, please run ./src/generate-crds-docs.sh and commit the changes"
git status
git diff
exit 1
fi
- name: Unit tests
run: mvn -B -ntp -nsu test -pl '!tests'
integration-tests:
name: Integration tests - ${{ matrix.name }}
runs-on: ubuntu-20.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: Scaling
group: scaling
num_agents: 0
- name: Scaling (BookKeeper)
group: bk-scaling
num_agents: 0
- name: Misc
group: misc
num_agents: 0
- name: Helm
group: helm
num_agents: 0
setup_helm: "true"
- name: Helm (TLS)
group: helm-tls
num_agents: 0
setup_helm: "true"
- name: Helm (TLS) Pulsar 3
group: helm-tls-pulsar3
num_agents: 0
setup_helm: "true"
- name: Helm Kafka (TLS)
group: helm-tls-kafka
num_agents: 0
setup_helm: "true"
- name: Helm BK racks (TLS)
group: helm-tls-bkracks
num_agents: 0
setup_helm: "true"
# - name: Multi nodes
# group: multi-nodes
# num_agents: 1
steps:
- name: checkout
uses: actions/checkout@v3
- uses: azure/setup-helm@v3
with:
version: latest
token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.setup_helm == 'true' }}
- name: Build Helm charts
run: |
set -e
add_repos() {
chart=$1
cat $chart/Chart.yaml | grep "repository:" | grep -e "https://" -e "http://" | awk '{print $2}' | awk -F'/' '{print $NF} {print $0}' | xargs -n2 helm repo add
}
add_repos helm/kaap-stack
helm dependency build helm/kaap
helm dependency build helm/kaap-stack
if: ${{ matrix.setup_helm == 'true' }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Setup ssh access to build runner VM
if: ${{ github.event_name == 'pull_request' }}
uses: apache/pulsar/.github/actions/ssh-access@master
continue-on-error: true
with:
limit-access-to-actor: true
- name: Build
run: mvn -B -T 1C -ntp -nsu clean install -DskipTests -pl tests -am -Dcheckstyle.skip -Dspotbugs.skip -Pskip-crds
- name: Integration tests
run: |
#!/bin/bash
mvn -B -ntp -nsu test -pl tests \
-Dgroups='${{ matrix.group }}' \
-Dkaap.tests.env.existing.k3s.agents='${{ matrix.num_agents }}'
- name: Upload Surefire reports
uses: actions/upload-artifact@v3
if: failure()
continue-on-error: true
with:
name: test-logs-${{ matrix.group }}
path: "**/target/operator-test-logs/*"
retention-days: 7