Rework IT Tests (#26) #90
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: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# - name: Set up JDK 17 | |
# uses: actions/setup-java@v3 | |
# with: | |
# java-version: '17' | |
# distribution: 'temurin' | |
- name: Set up JDK 1.8 | |
id: setupJava | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Install Protoc | |
id: setupProtoc | |
uses: arduino/setup-protoc@v2 | |
with: | |
version: "24.x" | |
include-pre-releases: false | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print Protoc version | |
run: protoc --version | |
- name: Print setupProtoc outputs | |
run: whereis protoc | |
- name: List protoc binaries | |
run: cd ${{steps.setupProtoc.outputs.path}}/bin && ls | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm install -g protoc-gen-js # Required for the IT tests | |
- uses: cactuslab/maven-toolchains-xml-action@v1 | |
with: | |
toolchains: | | |
[ | |
{"jdkVersion": "1.8", "jdkHome": "${{steps.setupJava.outputs.path}}"}, | |
{ | |
"type": "protobuf", | |
"provides": { | |
"version": "3.24.2" | |
}, | |
"configuration": { | |
"protocExecutable": "${{steps.setupProtoc.outputs.path}}/bin/protoc" | |
} | |
} | |
] | |
- name: Build | |
run: mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn compile | |
- name: Unit Tests | |
run: mvn -B test -ff | |
- name: Integrations Tests | |
run: mvn -B -Prun-its verify | |
- name: Print ITs error logs | |
if: failure() | |
run: cat target/it/*/build.log | |
- name: Package | |
run: mvn -B package -Dmaven.test.skip | |
- name: Verify | |
run: mvn -B verify -Dmaven.test.skip | |
- name: Install | |
run: mvn -B install -Dmaven.test.skip | |
- name: Extract PR number | |
if: github.event_name == 'pull_request' | |
run: echo ${{ github.event.number }} > PR_NUMBER.txt | |
- name: Store PR number | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PR_NUMBER | |
path: PR_NUMBER.txt | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Store build files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BUILD_FILES | |
path: | | |
target | |
retention-days: 1 | |
if-no-files-found: error |