|
| 1 | +name: ci |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + |
| 5 | + |
| 6 | +env: |
| 7 | + GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" |
| 8 | + total-runners: 6 |
| 9 | + |
| 10 | +jobs: |
| 11 | + javadoc_17: |
| 12 | + runs-on: [ self-hosted ] |
| 13 | + needs: compile |
| 14 | + if: ${{ github.actor != 'dependabot[bot]' }} |
| 15 | + steps: |
| 16 | + - name: Checkout Repo |
| 17 | + uses: actions/checkout@v3 |
| 18 | + - name: Set up Java 17 |
| 19 | + uses: actions/setup-java@v3 |
| 20 | + with: |
| 21 | + distribution: adopt |
| 22 | + java-version: 17 |
| 23 | + cache: gradle |
| 24 | + - name: Restore classes |
| 25 | + uses: actions/cache@v3 |
| 26 | + with: |
| 27 | + path: "**/*.class" |
| 28 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} |
| 29 | + - name: javadoc (JDK 17) |
| 30 | + run: ./gradlew --no-daemon javadoc |
| 31 | + assemble: |
| 32 | + runs-on: [self-hosted, Linux, X64] |
| 33 | + needs: compile |
| 34 | + timeout-minutes: 30 |
| 35 | + if: ${{ github.actor != 'dependabot[bot]' }} |
| 36 | + steps: |
| 37 | + - name: export runner UID |
| 38 | + run: echo "runner_uid=$UID" >> $GITHUB_ENV |
| 39 | + - name: Checkout Repo |
| 40 | + uses: actions/checkout@v3 |
| 41 | + - name: Set up Java |
| 42 | + uses: actions/setup-java@v3 |
| 43 | + with: |
| 44 | + distribution: adopt |
| 45 | + java-version: 17 |
| 46 | + cache: gradle |
| 47 | + - name: Restore classes |
| 48 | + uses: actions/cache@v3 |
| 49 | + with: |
| 50 | + path: "**/*.class" |
| 51 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} |
| 52 | + - name: Assemble |
| 53 | + uses: gradle/gradle-build-action@v2 |
| 54 | + with: |
| 55 | + arguments: assemble -Dorg.gradle.parallel=true |
| 56 | + - uses: actions/upload-artifact@v3.1.0 |
| 57 | + with: |
| 58 | + name: besu-zip |
| 59 | + path: build/distributions/*.zip |
| 60 | + - name: Correct Ownership in GITHUB_WORKSPACE directory |
| 61 | + uses: peter-murray/reset-workspace-ownership-action@v1 |
| 62 | + with: |
| 63 | + user_id: ${{env.runner_uid}} |
| 64 | + testWindows: |
| 65 | + runs-on: windows-2022 |
| 66 | + needs: assemble |
| 67 | + timeout-minutes: 10 |
| 68 | + if: ${{ github.actor != 'dependabot[bot]' }} |
| 69 | + steps: |
| 70 | + - name: Set up Java |
| 71 | + uses: actions/setup-java@v3 |
| 72 | + with: |
| 73 | + distribution: adopt |
| 74 | + java-version: 17 |
| 75 | + - name: Download zip |
| 76 | + uses: actions/download-artifact@v3 |
| 77 | + with: |
| 78 | + name: besu-zip |
| 79 | + - name: test Besu |
| 80 | + run: | |
| 81 | + unzip besu-*.zip -d besu-tmp |
| 82 | + cd besu-tmp |
| 83 | + mv besu-* ../besu |
| 84 | + cd .. |
| 85 | + besu\bin\besu.bat --help |
| 86 | + besu\bin\besu.bat --version |
| 87 | + runner-indexes: |
| 88 | + runs-on: ubuntu-22.04 |
| 89 | + name: Generate runner indexes |
| 90 | + outputs: |
| 91 | + json: ${{ steps.generate-index-list.outputs.json }} |
| 92 | + steps: |
| 93 | + - id: generate-index-list |
| 94 | + run: | |
| 95 | + MAX_INDEX=$((${{ env.total-runners }}-1)) |
| 96 | + INDEX_LIST=$(seq 0 ${MAX_INDEX}) |
| 97 | + INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) |
| 98 | + echo "::set-output name=json::${INDEX_JSON}" |
| 99 | + run-tests: |
| 100 | + runs-on: [self-hosted, Linux, X64] |
| 101 | + timeout-minutes: 60 |
| 102 | + name: "Run test suite" |
| 103 | + needs: |
| 104 | + - compile |
| 105 | + steps: |
| 106 | + - name: Checkout Repo |
| 107 | + uses: actions/checkout@v3 |
| 108 | + - name: Set up Java |
| 109 | + uses: actions/setup-java@v3 |
| 110 | + with: |
| 111 | + distribution: adopt |
| 112 | + java-version: 17 |
| 113 | + cache: gradle |
| 114 | + - name: Restore classes |
| 115 | + uses: actions/cache@v3 |
| 116 | + with: |
| 117 | + path: "**/*.class" |
| 118 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} |
| 119 | + - name: test |
| 120 | + uses: gradle/gradle-build-action@v2 |
| 121 | + with: |
| 122 | + arguments: test |
| 123 | + - name: Upload Test Report |
| 124 | + uses: actions/upload-artifact@v3 |
| 125 | + if: always() # always run even if the previous step fails |
| 126 | + with: |
| 127 | + name: junit-test-results |
| 128 | + path: '**/build/test-results/test/TEST-*.xml' |
| 129 | + retention-days: 1 |
| 130 | + - name: Upload Test Report html |
| 131 | + uses: actions/upload-artifact@v3 |
| 132 | + if: always() # always run even if the previous step fails |
| 133 | + with: |
| 134 | + name: junit-test-results-html |
| 135 | + path: '**/build/reports/*' |
| 136 | + retention-days: 1 |
| 137 | + integration-test: |
| 138 | + runs-on: [self-hosted, Linux, X64] |
| 139 | + needs: compile |
| 140 | + timeout-minutes: 30 |
| 141 | + if: ${{ github.actor != 'dependabot[bot]' }} |
| 142 | + steps: |
| 143 | + - name: export runner UID |
| 144 | + run: echo "runner_uid=$UID" >> $GITHUB_ENV |
| 145 | + - name: Checkout Repo |
| 146 | + uses: actions/checkout@v3 |
| 147 | + - name: Set up Java |
| 148 | + uses: actions/setup-java@v3 |
| 149 | + with: |
| 150 | + distribution: adopt |
| 151 | + java-version: 17 |
| 152 | + cache: gradle |
| 153 | + - name: Restore classes |
| 154 | + uses: actions/cache@v3 |
| 155 | + with: |
| 156 | + path: "**/*.class" |
| 157 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} |
| 158 | + - name: test |
| 159 | + uses: gradle/gradle-build-action@v2 |
| 160 | + with: |
| 161 | + arguments: integrationTest |
| 162 | + - name: Correct Ownership in GITHUB_WORKSPACE directory |
| 163 | + uses: peter-murray/reset-workspace-ownership-action@v1 |
| 164 | + with: |
| 165 | + user_id: ${{ env.runner_uid }} |
| 166 | + - name: Upload Test Report |
| 167 | + uses: actions/upload-artifact@v3 |
| 168 | + if: always() # always run even if the previous step fails |
| 169 | + with: |
| 170 | + name: junit-integration-test-results |
| 171 | + path: '**/build/test-results/integrationTest/TEST-*.xml' |
| 172 | + retention-days: 1 |
0 commit comments