-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update checkout action to v4 (#6197)
Signed-off-by: Sally MacFarlane <[email protected]> Signed-off-by: Justin Florentine <[email protected]>
- Loading branch information
Showing
14 changed files
with
192 additions
and
630 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: acceptance-tests | ||
on: | ||
workflow_call: | ||
pull_request_review: | ||
types: [ submitted ] | ||
|
||
|
||
env: | ||
|
@@ -9,7 +10,8 @@ env: | |
|
||
jobs: | ||
runner-indexes: | ||
runs-on: ubuntu-22.04 | ||
runs-on: | ||
group: "Besu Large Runners" | ||
name: Generate runner indexes | ||
outputs: | ||
json: ${{ steps.generate-index-list.outputs.json }} | ||
|
@@ -21,23 +23,17 @@ jobs: | |
INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) | ||
echo "::set-output name=json::${INDEX_JSON}" | ||
acceptanceTestEthereum: | ||
runs-on: [ self-hosted, X64, Linux ] | ||
runs-on: | ||
group: "Besu Large Runners" | ||
name: "Acceptance Runner #${{ matrix.runner-index }}: Run acceptance tests in parallel" | ||
needs: | ||
- runner-indexes | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
if: ${{ github.actor != 'dependabot[bot]'}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }} | ||
steps: | ||
- name: export runner UID | ||
run: echo "runner_uid=$UID" >> $GITHUB_ENV | ||
- name: install native packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libsodium23 libsodium-dev libjemalloc-dev apt-transport-https haveged libnss3-tools | ||
sudo service haveged restart | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Java | ||
|
@@ -46,11 +42,12 @@ jobs: | |
distribution: adopt | ||
java-version: 17 | ||
cache: gradle | ||
- name: Restore classes | ||
uses: actions/cache@v3 | ||
- name: Compile | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
path: "**/*.class" | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} | ||
gradle-home-cache-cleanup: true | ||
cache-read-only: false | ||
arguments: compileJava compileTestJava -Dorg.gradle.parallel=true | ||
- name: Split tests | ||
id: split-tests | ||
uses: chaosaffe/[email protected] | ||
|
@@ -71,21 +68,8 @@ jobs: | |
run: ./gradlew acceptanceTest --tests `cat gradleArgs.txt` | ||
- name: cleanup tempfiles | ||
run: rm testList.txt gradleArgs.txt | ||
- name: Correct Ownership in GITHUB_WORKSPACE directory | ||
uses: peter-murray/reset-workspace-ownership-action@v1 | ||
with: | ||
user_id: ${{ env.runner_uid }} | ||
- name: Upload Test Report | ||
uses: actions/upload-artifact@v3 | ||
if: always() # always run even if the previous step fails | ||
with: | ||
name: junit-acceptance-${{ matrix.runner-index }}-test-results | ||
path: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml' | ||
retention-days: 1 | ||
- name: Acceptance Test Report html | ||
uses: actions/upload-artifact@v3 | ||
if: always() # always run even if the previous step fails | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() # always run even if the build step fails | ||
with: | ||
name: html-acceptance-${{ matrix.runner-index }}-test-results | ||
path: 'acceptance-tests/tests/build/reports/tests/acceptanceTest/**' | ||
retention-days: 1 | ||
report_paths: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml' |
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,13 @@ | ||
name: callee | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ "caller" ] | ||
types: [ "requested" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
echo: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- run: echo called |
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,9 @@ | ||
name: caller | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
echo: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- run: echo calling |
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,37 @@ | ||
name: "checks" | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: "Repository Linting" | ||
runs-on: ubuntu-22.04 | ||
container: ghcr.io/todogroup/repolinter:v0.11.2 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Lint Repo | ||
run: bundle exec /app/bin/repolinter.js --rulesetUrl https://raw.githubusercontent.com/hyperledger-labs/hyperledger-community-management-tools/main/repo_structure/repolint.json --format markdown | ||
gradle-wrapper: | ||
name: "Gradle Wrapper Validation" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gradle/[email protected] | ||
spotless: | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- name: spotless | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: build spotlessCheck -Dorg.gradle.parallel=true | ||
cache: gradle |
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
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
name: "Validate Gradle Wrapper" | ||
name: gradle-wrapper-validation | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
|
||
jobs: | ||
validation: | ||
name: "Gradle Wrapper Validation" | ||
runs-on: [besu-research-ubuntu-8] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gradle/wrapper-validation-action@v1 |
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
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,48 @@ | ||
name: parallel-unit-tests | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | ||
total-runners: 4 | ||
jobs: | ||
junit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner_index: | ||
- 0 | ||
- 1 | ||
- 2 | ||
- 3 | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Split tests | ||
id: split-tests | ||
uses: chaosaffe/[email protected] | ||
with: | ||
glob: '**/src/test/java/**/*.java' | ||
split-total: ${{ env.total-runners }} | ||
split-index: ${{ matrix.runner_index }} | ||
line-count: true | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
cache: gradle | ||
- name: write out test list | ||
run: echo "${{ steps.split-tests.outputs.test-suite }}" >> testList.txt | ||
- name: debug testfile paths | ||
run: cat testList.txt | ||
- name: format gradle args | ||
# regex means: truncate file paths to align with package name, replacing with tests switch, then drop file extension, | ||
# then swap path delimiter with package delimiter | ||
run: cat testList.txt | sed -e 's/[^ ]*src\/test\/java\//--tests\ /g' -e 's/\.java//g' -e 's/\//\./g' >> gradleArgs.txt | ||
- name: debug test class list | ||
run: cat gradleArgs.txt | ||
- name: run unit tests | ||
run: ./gradlew test `cat gradleArgs.txt` | ||
|
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
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
Oops, something went wrong.