-
Notifications
You must be signed in to change notification settings - Fork 22
82 lines (75 loc) · 2.36 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'kubernetes/**'
- '**.md'
- 'grafana/**'
- 'prometheus/**'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 90
name: Build
steps:
- uses: actions/checkout@v3
- name: Build project
env:
DSE_REPO_USERNAME: ${{ secrets.DSE_REPO_USERNAME }}
DSE_REPO_PASSWORD: ${{ secrets.DSE_REPO_PASSWORD }}
run: |
./gradlew -Pdse4 -PdseRepoUsername=$DSE_REPO_USERNAME -PdseRepoPassword=$DSE_REPO_PASSWORD \
build -x test -x backfill-cli:compileJava
test:
needs: build
name: Test
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
module: ['agent', 'agent-c3', 'agent-c4', 'agent-dse4', 'connector']
jdk: ['11', '17']
pulsarImage: ['datastax/lunastreaming:2.10_3.4', 'apachepulsar/pulsar:2.10.3', 'apachepulsar/pulsar:2.11.0']
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'adopt'
- name: Get project version
uses: HardNorth/github-version-generate@v1.3.0
with:
version-source: file
version-file: gradle.properties
version-file-extraction-pattern: '(?<=version=).+'
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Test with Gradle
env:
DSE_REPO_USERNAME: ${{ secrets.DSE_REPO_USERNAME }}
DSE_REPO_PASSWORD: ${{ secrets.DSE_REPO_PASSWORD }}
run: |
set -e
PREV_IFS=$IFS
IFS=':'
read -ra PULSAR_FULL_IMAGE <<< "${{ matrix.pulsarImage }}"
IFS=$PREV_IFS
PULSAR_IMAGE=${PULSAR_FULL_IMAGE[0]}
PULSAR_IMAGE_TAG=${PULSAR_FULL_IMAGE[1]}
./gradlew -Pdse4 -PdseRepoUsername=$DSE_REPO_USERNAME -PdseRepoPassword=$DSE_REPO_PASSWORD \
-PtestPulsarImage=$PULSAR_IMAGE \
-PtestPulsarImageTag=$PULSAR_IMAGE_TAG \
${{ matrix.module }}:test