test: enhance integration tests #238
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: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and test Java ${{ matrix.java }} | |
permissions: | |
checks: write | |
pull-requests: write | |
env: | |
MAIN_JAVA_VER: 11 | |
RUN_PYTHON_BIN: ${{ vars.RUN_PYTHON_BIN }} | |
strategy: | |
matrix: | |
java: [11, 20] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Setup Java ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java }} | |
cache: maven | |
- name: setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20.1' | |
- name: get Python location | |
id: python-location | |
run: | | |
echo "python-bin-location=$(echo $pythonLocation)/bin" >> $GITHUB_OUTPUT | |
- name: get java location | |
id: java-location | |
run: | | |
echo "java-bin-location=$(which java | awk -F "/bin/java" '{print $1}')" >> $GITHUB_OUTPUT | |
mvn wrapper:wrapper -Dmaven=3.8.4 | |
echo "mavenWrapper=$(dirname $(which ./mvnw))" >> $GITHUB_OUTPUT | |
- name: Verify the project and create coverage report | |
env: | |
EXHORT_PYTHON3_PATH: "${{steps.python-location.outputs.python-bin-location}}/python3" | |
EXHORT_PIP3_PATH: "${{steps.python-location.outputs.python-bin-location}}/pip3" | |
JAVA_HOME: "${{steps.java-location.outputs.java-bin-location}}" | |
EXHORT_MAVEN_PATH: "${{steps.java-location.outputs.mavenWrapper}}/mvnw" | |
run: | | |
./mvnw --version | |
mvn verify -Dskip.junit_platform=true -Pits,cov -B -ff | |
- name: Report test summary | |
if: ${{ matrix.java == env.MAIN_JAVA_VER && always() }} | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
test_changes_limit: 0 | |
files: | | |
./target/surefire-reports/*.xml | |
./target/junit-platform/TEST-junit-jupiter.xml | |
- name: Upload coverage reports | |
if: ${{ matrix.java == env.MAIN_JAVA_VER }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: ./target/site/jacoco/jacoco.xml |