diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ca2f6c05861..09148c9a40c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -11,7 +11,7 @@ on: - "**" jobs: - build-rskj: + build: runs-on: ubuntu-latest container: image: openjdk:8-jdk @@ -94,12 +94,18 @@ jobs: path: | rskj-core/build - - name: Download test reports + - name: Download test results uses: actions/download-artifact@v4 with: - name: test-report + name: test-results path: | rskj-core/build/test-results/ + + - name: Download test reports + uses: actions/download-artifact@v4 + with: + name: test-reports + path: | rskj-core/build/reports/ - name: Run SonarQube analysis @@ -119,6 +125,8 @@ jobs: -Dsonar.organization=rsksmart \ -Dsonar.projectKey=rskj \ -Dsonar.host.url="https://sonarcloud.io" \ + -Dsonar.junit.reportPaths=rskj-core/build/test-results/ \ + -Dsonar.coverage.jacoco.xmlReportPaths=rskj-core/build/reports/jacoco/test/jacocoTestReport.xml \ -Dsonar.token="$SONAR_TOKEN" else ./gradlew sonarqube --no-daemon -x build -x test \ @@ -126,12 +134,14 @@ jobs: -Dsonar.organization=rsksmart \ -Dsonar.projectKey=rskj \ -Dsonar.host.url="https://sonarcloud.io" \ + -Dsonar.junit.reportPaths=rskj-core/build/test-results/ \ + -Dsonar.coverage.jacoco.xmlReportPaths=rskj-core/build/reports/jacoco/test/jacocoTestReport.xml \ -Dsonar.token="$SONAR_TOKEN" fi mining-tests: - needs: build-rskj + needs: build runs-on: ubuntu-latest services: bitcoind1: @@ -219,7 +229,7 @@ jobs: | cut -d = -f 2- | paste -sd - -) echo "Using RskJ version $version at ../rskj-core/build/libs/rskj-core-$version-all.jar" java -Drsk.conf.file=./rsk-integration-test.conf -cp ../rskj-core/build/libs/rskj-core-"$version"-all.jar co.rsk.Start --regtest & rskpid=$! - + tries=0 MAX_TRIES=10 while [ $tries -lt $MAX_TRIES ]; do @@ -228,16 +238,17 @@ jobs: tries=$((tries+1)) sleep 1 done - + if [ $tries -eq $MAX_TRIES ]; then echo "RskJ unreachable after $MAX_TRIES attempts. Aborting." >&2 exit 1 fi - + npm test kill $rskpid unit-tests: + needs: build runs-on: ubuntu-latest container: image: openjdk:8-jdk @@ -270,12 +281,18 @@ jobs: run: | ./gradlew --no-daemon --stacktrace test - - name: Persist test reports for sonar + - name: Persist test results for sonar uses: actions/upload-artifact@v4 with: - name: test-report + name: test-results path: | rskj-core/build/test-results/ + + - name: Persist test reports for sonar + uses: actions/upload-artifact@v4 + with: + name: test-reports + path: | rskj-core/build/reports/ integration-tests: