-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08a2e20
commit 930056e
Showing
2 changed files
with
201 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
name: 'testResults' | ||
description: 'Collate test results and reports' | ||
|
||
inputs: | ||
suiteName: | ||
description: 'name of the test suite' | ||
required: false | ||
default: 'test' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Gather test results | ||
shell: bash | ||
run: | | ||
rm -rf build/test-output | ||
FILES=`find . -name test-results` | ||
for FILE in $FILES | ||
do | ||
MODULE=`echo "$FILE" | sed -e 's@./\(.*\)/build/test-results@\1@'` | ||
TARGET="build/test-output/$MODULE" | ||
mkdir -p "$TARGET" | ||
# cp -rf ${FILE}/*/* "$TARGET" | ||
find ${FILE} -mindepth 2 -maxdepth 2 -print0 | xargs -0 -I{} cp -rf {} $TARGET | ||
done | ||
tree build/test-output/ | ||
# - name: Gather test reports | ||
# shell: bash | ||
# run: | | ||
# rm -rf build/test-reports | ||
# FILES=`find . -name reports -not -path './build/reports'` | ||
# for FILE in $FILES | ||
# do | ||
# MODULE=`echo "$FILE" | sed -e 's@./\(.*\)/build/reports@\1@'` | ||
# TARGET="build/test-reports/$MODULE" | ||
# SOURCE="${FILE}/tests/test" | ||
# mkdir -p "$TARGET" | ||
# if [[ -d "$SOURCE" ]]; then | ||
# cp -rf "$SOURCE" "$TARGET" | ||
# fi | ||
# done | ||
# if [[ -f 'build/reports/dependency-check-report.html' ]]; then | ||
# cp 'build/reports/dependency-check-report.html' 'build/test-reports' | ||
# fi | ||
# tree build/test-reports/ | ||
|
||
- name: Publish Test Results and Reports | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ${{ inputs.suiteName }} | ||
if-no-files-found: ignore | ||
retention-days: 7 | ||
path: | | ||
build/test-output/ | ||
build/test-reports/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,40 @@ env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4 -Xmx4096m | ||
|
||
jobs: | ||
|
||
spotless: | ||
runs-on: ubuntu-24.04 | ||
environment: dev | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Prepare | ||
uses: ./.github/actions/prepare | ||
|
||
- name: Spotless | ||
run: | | ||
./gradlew spotlessCheck | ||
moduleChecks: | ||
runs-on: ubuntu-24.04 | ||
environment: dev | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Prepare | ||
uses: ./.github/actions/prepare | ||
|
||
- name: Check modules | ||
run: | | ||
./gradlew checkMavenCoordinateCollisions checkModuleDependencies | ||
assemble: | ||
# 4 cpu, 16G ram | ||
runs-on: ubuntu-24.04 | ||
environment: dev | ||
steps: | ||
|
@@ -54,7 +86,7 @@ jobs: | |
path: | | ||
./ | ||
!./.git/** | ||
retention-days: 7 | ||
retention-days: 1 | ||
|
||
unitTests: | ||
needs: assemble | ||
|
@@ -85,6 +117,12 @@ jobs: | |
echo "Prepared arguments for Gradle: $GRADLE_ARGS" | ||
./gradlew test $GRADLE_ARGS | ||
- name: Test results | ||
uses: ./.github/actions/testResultsReports | ||
if: always() | ||
with: | ||
suiteName: 'unitTests' | ||
|
||
integrationTests: | ||
needs: assemble | ||
# 32 cpu, 128G ram | ||
|
@@ -109,6 +147,12 @@ jobs: | |
ls -la . | ||
./gradlew integrationTest | ||
- name: Test results | ||
uses: ./.github/actions/testResultsReports | ||
if: always() | ||
with: | ||
suiteName: 'integrationTests' | ||
|
||
propertyTests: | ||
needs: assemble | ||
# 32 cpu, 128G ram | ||
|
@@ -138,6 +182,12 @@ jobs: | |
echo "Prepared arguments for Gradle: $GRADLE_ARGS" | ||
./gradlew --info propertyTest $GRADLE_ARGS | ||
- name: Test results | ||
uses: ./.github/actions/testResultsReports | ||
if: always() | ||
with: | ||
suiteName: 'propertyTests' | ||
|
||
acceptanceTests: | ||
needs: assemble | ||
# 32 cpu, 128G ram | ||
|
@@ -166,3 +216,93 @@ jobs: | |
GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}') | ||
echo "Prepared arguments for Gradle: $GRADLE_ARGS" | ||
./gradlew acceptanceTest $GRADLE_ARGS | ||
- name: Test results | ||
uses: ./.github/actions/testResultsReports | ||
if: always() | ||
with: | ||
suiteName: 'acceptanceTests' | ||
|
||
referenceTests: | ||
needs: assemble | ||
# 32 cpu, 128G ram | ||
runs-on: ubuntu-latest-128 | ||
environment: dev | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Prepare | ||
uses: ./.github/actions/prepare | ||
|
||
- name: Download workspace build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: workspace | ||
|
||
- name: Fetch Reference Tests | ||
run: | | ||
if [ ! -d "eth-reference-tests/src/referenceTest/resources/consensus-spec-tests/tests" ] | ||
then | ||
./gradlew --no-daemon expandRefTests | ||
fi | ||
# Compile separately so that we have the generated test files for splitting across nodes | ||
- name: CompileReferenceTests | ||
run: | | ||
./gradlew --no-daemon --parallel compileReferenceTestJava | ||
- name: Reference Tests | ||
run: | | ||
CLASSNAMES=$(find . -iwholename "**/src/referenceTest/generated_tests/**/*Test.java" \ | ||
| sed 's@.*/src/referenceTest/generated_tests/@@' \ | ||
| sed 's@/@.@g' \ | ||
| sed 's/.\{5\}$//' ) | ||
GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}') | ||
echo "Prepared arguments for Gradle: $GRADLE_ARGS" | ||
./gradlew -x generateReferenceTestClasses -x processReferenceTestResources -x cleanReferenceTestClasses referenceTest $GRADLE_ARGS | ||
- name: Test results | ||
uses: ./.github/actions/testResultsReports | ||
if: always() | ||
with: | ||
suiteName: 'referenceTests' | ||
|
||
|
||
windowsBuild: | ||
needs: [spotless, moduleChecks ] | ||
# 32 cpu, 128G ram | ||
runs-on: windows-2022 | ||
environment: dev | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: 21 | ||
distribution: 'adopt' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Build | ||
shell: powershell | ||
run: | | ||
$Env:JAVA_TOOL_OPTIONS = "-Xmx2g" | ||
$Env:GRADLE_OPTS = "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.vfs.watch=false" | ||
cmd.exe /c gradlew.bat --no-daemon --parallel --build-cache | ||
# - run: | ||
# name: "Gather test artifacts" | ||
# when: "always" | ||
# command: | | ||
# New-Item -ItemType Directory -Force build\test-results | ||
# Get-ChildItem -Recurse | Where-Object {$_.FullName -match "test-results\\.*\\.*.xml"} | Copy-Item -Destination build\test-results\ | ||
# - store_test_results: | ||
# path: build/test-results |