From 3d6b1ace030153682b5605165762156dce1f3b08 Mon Sep 17 00:00:00 2001 From: Kyle Aure Date: Tue, 7 Nov 2023 09:54:59 -0600 Subject: [PATCH 1/3] Re-enable testspace Signed-off-by: Kyle Aure --- .github/workflows/microshed-ci.yml | 45 +++++++++++++++++++----------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/microshed-ci.yml b/.github/workflows/microshed-ci.yml index 08d3d0c9..712e0991 100644 --- a/.github/workflows/microshed-ci.yml +++ b/.github/workflows/microshed-ci.yml @@ -2,9 +2,11 @@ name: MicroShed CI on: push: + branches: + - main pull_request: branches: - - main + - main types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - '.gitignore' @@ -18,27 +20,27 @@ env: LANG: en_US.UTF-8 jobs: build: - runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest ] java: [ 11 ] fail-fast: false max-parallel: 4 + + runs-on: ${{ matrix.os }} name: Build ${{ matrix.java }}, ${{ matrix.os }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Set up Java - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - cache: gradle - - name: Build with Gradle - run: | - chmod +x gradlew - ./gradlew assemble testClasses + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: gradle + - name: Build with Gradle + run: | + chmod +x gradlew + ./gradlew assemble testClasses integration_tests: name: Tests - ${{matrix.category}} runs-on: ubuntu-latest @@ -71,12 +73,14 @@ jobs: wildfly-app steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Set up Java - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 + - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: java-version: 11 distribution: 'temurin' cache: gradle + - uses: testspace-com/setup-testspace@ee1482f978eb5010ec27b6f6372904f01f2edd68 # v1.0.6 + with: + domain: ${{github.repository_owner}} - name: Run integration tests shell: bash env: @@ -85,6 +89,8 @@ jobs: run: | chmod +x gradlew echo "org.gradle.daemon=false" >> gradle.properties + + mkdir results echo "Will be running projects $TEST_PROJECTS" for TEST_PROJECT in $TEST_PROJECTS @@ -95,7 +101,14 @@ jobs: fi echo "### BEGIN running test project $TEST_PROJECT" ./gradlew :microshed-testing-$TEST_PROJECT:test - echo "### END running test project $TEST_PROJECT"; + echo "### END running test project $TEST_PROJECT"; + + cp sample-apps/$TEST_PROJECT/build/test-results/test/TEST-*.xml results/ done + + ls -la results/ echo "Done running all tests." + - name: Upload test results + # if: ${{ github.event_name == 'push' }} Commented out for now to test this + run: testspace "[ ${{ matrix.category }} ]results/TEST-*.xml" From b8b401a0a867cca105142f1617dedfb55019bad9 Mon Sep 17 00:00:00 2001 From: Kyle Aure Date: Tue, 7 Nov 2023 10:10:56 -0600 Subject: [PATCH 2/3] Account for maven test results Signed-off-by: Kyle Aure --- .github/workflows/microshed-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/microshed-ci.yml b/.github/workflows/microshed-ci.yml index 712e0991..2c18fceb 100644 --- a/.github/workflows/microshed-ci.yml +++ b/.github/workflows/microshed-ci.yml @@ -103,7 +103,16 @@ jobs: ./gradlew :microshed-testing-$TEST_PROJECT:test echo "### END running test project $TEST_PROJECT"; - cp sample-apps/$TEST_PROJECT/build/test-results/test/TEST-*.xml results/ + #Gradle test results + if [[ -d "sample-apps/$TEST_PROJECT/build/test-results/test/" ]]; then + cp sample-apps/$TEST_PROJECT/build/test-results/test/TEST-*.xml results/ + fi + + #Maven test results + if [[ -d "sample-apps/$TEST_PROJECT/target/test-failsafe-reports/" ]]; then + cp sample-apps/$TEST_PROJECT/target/test-failsafe-reports/TEST-*.xml results/ + fi + done ls -la results/ From fdd457ccb34c8180b9a214169d58d24938aa28fb Mon Sep 17 00:00:00 2001 From: Kyle Aure Date: Tue, 7 Nov 2023 10:17:29 -0600 Subject: [PATCH 3/3] Enable only when push Signed-off-by: Kyle Aure --- .github/workflows/microshed-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/microshed-ci.yml b/.github/workflows/microshed-ci.yml index 2c18fceb..59cde9d1 100644 --- a/.github/workflows/microshed-ci.yml +++ b/.github/workflows/microshed-ci.yml @@ -79,6 +79,7 @@ jobs: distribution: 'temurin' cache: gradle - uses: testspace-com/setup-testspace@ee1482f978eb5010ec27b6f6372904f01f2edd68 # v1.0.6 + if: ${{ github.event_name == 'push' }} with: domain: ${{github.repository_owner}} - name: Run integration tests @@ -114,10 +115,9 @@ jobs: fi done - - ls -la results/ - echo "Done running all tests." + echo "Done running all tests, results folder contains:" + ls -la results/ - name: Upload test results - # if: ${{ github.event_name == 'push' }} Commented out for now to test this + if: ${{ github.event_name == 'push' }} run: testspace "[ ${{ matrix.category }} ]results/TEST-*.xml"