Merge pull request #917 from komamitsu/code-format #1012
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java_version: [8, 11] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java_version }} | |
- uses: actions/cache@v4 | |
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@v4 | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java_version }} | |
- uses: actions/cache@v4 | |
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@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- uses: actions/cache@v4 | |
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@v4 | |
with: | |
name: local-m2 | |
path: ~/.m2 | |
include-hidden-files: true | |
integration_test: | |
runs-on: ubuntu-latest | |
needs: prepare_for_integration_test | |
strategy: | |
matrix: | |
java_version: [8, 11, 17] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java_version }} | |
- uses: actions/cache@v4 | |
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@v4 | |
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@v4 | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java_version }} | |
- uses: actions/cache@v4 | |
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 | |