Skip to content

Commit

Permalink
update checkout action to v4 (#6197)
Browse files Browse the repository at this point in the history
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Justin Florentine <[email protected]>
  • Loading branch information
macfarla authored and jflo committed Dec 6, 2023
1 parent 2fc042c commit 6549660
Show file tree
Hide file tree
Showing 14 changed files with 192 additions and 630 deletions.
505 changes: 0 additions & 505 deletions .circleci/config.yml

Large diffs are not rendered by default.

48 changes: 16 additions & 32 deletions .github/workflows/acceptance-tests.yml
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:
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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'
13 changes: 13 additions & 0 deletions .github/workflows/callee.yml
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
9 changes: 9 additions & 0 deletions .github/workflows/caller.yml
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
37 changes: 37 additions & 0 deletions .github/workflows/checks.yml
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
48 changes: 7 additions & 41 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: compile
on:
push:
branches: [ main ]
pull_request:
workflow_run:
workflows:
- checks
types:
- completed

env:
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false"
total-runners: 6

jobs:
compile:
runs-on: ubuntu-22.04
timeout-minutes: 30
if: ${{ github.actor != 'dependabot[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand All @@ -25,39 +26,4 @@ jobs:
- name: Compile
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
cache-read-only: false
arguments: compileJava compileTestJava -Dorg.gradle.parallel=true
compileJmh:
runs-on: ubuntu-22.04
needs: compile
timeout-minutes: 30
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
cache: gradle
- name: compileJmh
uses: gradle/gradle-build-action@v2
with:
arguments: compileJmh

javadoc_17:
runs-on: ubuntu-22.04
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
cache: gradle
- name: javadoc (JDK 17)
run: ./gradlew --no-daemon javadoc
arguments: build -x test -x spotlessCheck -Dorg.gradle.parallel=true
10 changes: 4 additions & 6 deletions .github/workflows/gradle-wrapper-validation.yml
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
10 changes: 1 addition & 9 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: javadoc
on:
workflow_dispatch:
workflow_run:
workflows: [compile]
types:
- completed
workflow_call:

env:
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false"
Expand All @@ -23,9 +19,5 @@ jobs:
distribution: adopt
java-version: 17
cache: gradle
- name: Restore classes
uses: actions/download-artifact@v3
with:
name: classes
- name: javadoc (JDK 17)
run: ./gradlew --no-daemon javadoc
48 changes: 48 additions & 0 deletions .github/workflows/parallel-unit-tests.yml
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`

8 changes: 4 additions & 4 deletions .github/workflows/reference-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
runner-indexes:
runs-on: ubuntu-22.04
runs-on: besu-research-ubuntu-8
name: Generate runner indexes
outputs:
json: ${{ steps.generate-index-list.outputs.json }}
Expand All @@ -21,7 +21,7 @@ jobs:
INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST})
echo "::set-output name=json::${INDEX_JSON}"
prepareReferenceTestEthereum:
runs-on: [ self-hosted, Linux, X64 ]
runs-on: besu-research-ubuntu-8
timeout-minutes: 30
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
path: "ethereum/referencetests/build/generated/sources/reference-test/**"
key: ${{ runner.os }}-reftests-${{ github.sha }}
referenceTestEthereum:
runs-on: [ self-hosted, X64, Linux ]
runs-on: besu-research-ubuntu-8
needs:
- prepareReferenceTestEthereum
- runner-indexes
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
path: '**/build/test-results/referenceTests/TEST-*.xml'
retention-days: 1
referenceTestQbft:
runs-on: [ self-hosted, Linux, X64 ]
runs-on: besu-research-ubuntu-8
timeout-minutes: 30
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# SPDX-License-Identifier: Apache-2.0
# Hyperledger Repolinter Action
name: Repolinter
name: repolinter

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_call:


jobs:
build:
runs-on: [besu-research-ubuntu-16]
container: ghcr.io/todogroup/repolinter:v0.10.1
runs-on: ubuntu-22.04
container: ghcr.io/todogroup/repolinter:v0.11.2
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
Loading

0 comments on commit 6549660

Please sign in to comment.