-
-
Notifications
You must be signed in to change notification settings - Fork 35
151 lines (144 loc) · 4.93 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request: {}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [8, 11]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java_version }}
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ matrix.java_version }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run tests fluency-core
run: ./gradlew -p fluency-core check jacocoTestReport coveralls --stacktrace --info
- name: Run tests fluency-fluentd
run: ./gradlew -p fluency-fluentd check jacocoTestReport coveralls --stacktrace --info
- name: Run tests fluency-treasuredata
run: ./gradlew -p fluency-treasuredata check jacocoTestReport coveralls --stacktrace --info
- name: Run tests fluency-aws-s3
run: ./gradlew -p fluency-aws-s3 check jacocoTestReport coveralls --stacktrace --info
build_ext:
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [16, 17]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java_version }}
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ matrix.java_version }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run tests fluency-fluentd-ext
run: ./gradlew -p fluency-fluentd-ext check jacocoTestReport coveralls --stacktrace --info
# Fluency uses java.nio.ByteBuffer which can cause inconsistent method signature issue between JDK 8 and 9.
# We've created Fluency jars using JDK 8 for that and we need to confirm an application built with JDK 9 or later
# can use Fluecy jars built with JDK 8 without any problem.
# We're using --release option to build source code with JDK 8. So JDK 17 should work here.
prepare_for_integration_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-17-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Install local maven package
run: |
./gradlew -p fluency-core publishToMavenLocal --stacktrace --info
./gradlew -p fluency-fluentd publishToMavenLocal --stacktrace --info
- name: Upload local Maven package just installed
uses: actions/upload-artifact@v3
with:
name: local-m2
path: ~/.m2
integration_test:
runs-on: ubuntu-latest
needs: prepare_for_integration_test
strategy:
matrix:
java_version: [8, 11, 17]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java_version }}
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ matrix.java_version }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Remove m2 directory just in case
run: rm -rf ~/.m2
- name: Download local Maven package prepared above
uses: actions/download-artifact@v3
with:
name: local-m2
path: ~/.m2
- name: Run tests using real Fluentd
run: |
sudo gem install yajl-ruby --no-doc -v 1.4.1
sudo gem install fluentd --no-doc
echo "127.0.0.1 my-server" | sudo tee -a /etc/hosts
cd tests/mutual-tls && ./run.sh
integration_ext_test:
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [16, 17]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java_version }}
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ matrix.java_version }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Install local maven package
run: |
./gradlew publishToMavenLocal --stacktrace --info
- name: Run tests using real Fluentd
run: |
sudo gem install yajl-ruby --no-doc -v 1.4.1
sudo gem install fluentd --no-doc
sudo gem install fluent-plugin-flowcounter --no-doc
cd tests/unix-domain-socket && ./run.sh