Add LogOutputStream.create(LineConsumer) (#107) #64
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: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ 6, 8, 11, 17 ] | |
name: Build with Java ${{ matrix.java }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 6 | |
if: ${{ matrix.java == '6'}} | |
# We use v1 as newer versions do not seem to support Java 6 | |
# Inspired by https://github.com/junit-team/junit4/blob/main/.github/workflows/main.yml | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.java }} | |
mvn-toolchain-id: ${{ matrix.java }} | |
- name: Set up toolchains.xml for Java 6 | |
# We need to manually set up toolchains.xml as setup-java@v1 does not seem to support toolchains.xml | |
if: ${{ matrix.java == '6'}} | |
run: | | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >> $HOME/.m2/toolchains.xml | |
echo "<toolchains>" >> $HOME/.m2/toolchains.xml | |
echo " <toolchain>" >> $HOME/.m2/toolchains.xml | |
echo " <type>jdk</type>" >> $HOME/.m2/toolchains.xml | |
echo " <provides>" >> $HOME/.m2/toolchains.xml | |
echo " <version>6</version>" >> $HOME/.m2/toolchains.xml | |
echo " </provides>" >> $HOME/.m2/toolchains.xml | |
echo " <configuration>" >> $HOME/.m2/toolchains.xml | |
echo " <jdkHome>${JAVA_HOME_6_0_119_X64}</jdkHome>" >> $HOME/.m2/toolchains.xml | |
echo " </configuration>" >> $HOME/.m2/toolchains.xml | |
echo " </toolchain>" >> $HOME/.m2/toolchains.xml | |
echo "</toolchains>" >> $HOME/.m2/toolchains.xml | |
cat $HOME/.m2/toolchains.xml | |
- name: Set up JDK | |
if: ${{ matrix.java != '6'}} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
mvn-toolchain-id: ${{ matrix.java }} | |
distribution: temurin | |
cache: maven | |
- name: Set up JDK 17 | |
# Set up JDK 17 as the last step before building so it becomes default and Maven would use it | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
mvn-toolchain-id: 17 | |
distribution: temurin | |
cache: maven | |
- name: Build on Java 6, run tests with Java 17 | |
# Java 6 is special case, we need to activate a profile on it | |
if: ${{ matrix.java == '6'}} | |
run: | | |
chmod +x mvnw | |
./mvnw -ntp -B -P java6 -DtestJdk=17 test | |
- name: Build on Java 8, run tests with Java 17 | |
# Java 8 is also a special case, we need to activate a profile on it | |
if: ${{ matrix.java == '8'}} | |
run: | | |
chmod +x mvnw | |
./mvnw -ntp -B -P java8 -DtestJdk=17 test | |
- name: Build and test on Java ${{ matrix.java }} | |
# More modern JDKs support specifying a target JDK release for the compiler | |
if: ${{ matrix.java != '6' && matrix.java != '8' }} | |
run: | | |
chmod +x mvnw | |
./mvnw -ntp -B -DmainJdk=${{ matrix.java }} verify package | |
mkdir upload && cp target/*.jar upload | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Upload artifacts | |
path: upload |