Skip to content

Commit f01c086

Browse files
authored
Merge pull request #17 from jflo/gha_checks
Gha checks
2 parents 2513088 + d6e1468 commit f01c086

22 files changed

+860
-581
lines changed

.circleci/config.yml

Lines changed: 0 additions & 505 deletions
Large diffs are not rendered by default.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: acceptance-tests
2+
on:
3+
pull_request_review:
4+
types: [ submitted ]
5+
6+
7+
env:
8+
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false"
9+
total-runners: 6
10+
11+
jobs:
12+
runner-indexes:
13+
runs-on:
14+
group: "Besu Large Runners"
15+
name: Generate runner indexes
16+
outputs:
17+
json: ${{ steps.generate-index-list.outputs.json }}
18+
steps:
19+
- id: generate-index-list
20+
run: |
21+
MAX_INDEX=$((${{ env.total-runners }}-1))
22+
INDEX_LIST=$(seq 0 ${MAX_INDEX})
23+
INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST})
24+
echo "::set-output name=json::${INDEX_JSON}"
25+
acceptanceTestEthereum:
26+
runs-on:
27+
group: "Besu Large Runners"
28+
name: "Acceptance Runner #${{ matrix.runner-index }}: Run acceptance tests in parallel"
29+
needs:
30+
- runner-indexes
31+
if: ${{ github.actor != 'dependabot[bot]'}}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }}
36+
steps:
37+
- name: Checkout Repo
38+
uses: actions/checkout@v3
39+
- name: Set up Java
40+
uses: actions/setup-java@v3
41+
with:
42+
distribution: adopt
43+
java-version: 17
44+
cache: gradle
45+
- name: Compile
46+
uses: gradle/gradle-build-action@v2
47+
with:
48+
gradle-home-cache-cleanup: true
49+
cache-read-only: false
50+
arguments: compileJava compileTestJava -Dorg.gradle.parallel=true
51+
- name: Split tests
52+
id: split-tests
53+
uses: chaosaffe/split-tests@v1-alpha.1
54+
with:
55+
glob: 'acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/**/*Test.java'
56+
split-total: ${{ env.total-runners }}
57+
split-index: ${{ matrix.runner-index }}
58+
59+
- name: write out test list
60+
run: echo "${{ steps.split-tests.outputs.test-suite }}" >> testList.txt
61+
- name: format gradle args
62+
#regex means: first truncate file paths to align with package name, then swap path delimiter with package delimiter,
63+
#then drop file extension, then insert --tests option between each.
64+
run: cat testList.txt | sed -e 's@acceptance-tests/tests/src/test/java/@@g' -e 's@/@.@g' -e 's/\.java//g' -e 's/\ /\ --tests\ /g' >> gradleArgs.txt
65+
- name: list keystores
66+
run: find . -name "*.jks"
67+
- name: run acceptance tests
68+
run: ./gradlew acceptanceTest --tests `cat gradleArgs.txt`
69+
- name: cleanup tempfiles
70+
run: rm testList.txt gradleArgs.txt
71+
- name: Publish Test Report
72+
uses: mikepenz/action-junit-report@v4
73+
if: success() || failure() # always run even if the build step fails
74+
with:
75+
report_paths: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml'

.github/workflows/callee.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: callee
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "caller" ]
6+
types: [ "requested" ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
echo:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- run: echo called

.github/workflows/caller.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: caller
2+
3+
on: pull_request
4+
5+
jobs:
6+
echo:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- run: echo calling

.github/workflows/checks.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
name: checks
1+
name: "checks"
2+
23
on:
3-
push:
4-
branches: [ main ]
54
pull_request:
6-
workflow_dispatch:
75

86
jobs:
7+
lint:
8+
name: "Repository Linting"
9+
runs-on: ubuntu-22.04
10+
container: ghcr.io/todogroup/repolinter:v0.11.2
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
- name: Lint Repo
15+
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
16+
gradle-wrapper:
17+
name: "Gradle Wrapper Validation"
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: gradle/wrapper-validation-action@v1.1.0
922
spotless:
10-
runs-on: [besu-research-ubuntu-16]
23+
runs-on: ubuntu-22.04
1124
if: ${{ github.actor != 'dependabot[bot]' }}
1225
steps:
1326
- name: Checkout Repo
@@ -17,20 +30,8 @@ jobs:
1730
with:
1831
distribution: adopt
1932
java-version: 17
20-
cache: gradle
2133
- name: spotless
22-
run: ./gradlew --no-daemon --parallel clean spotlessCheck
23-
javadoc_17:
24-
runs-on: [besu-research-ubuntu-8]
25-
if: ${{ github.actor != 'dependabot[bot]' }}
26-
steps:
27-
- name: Checkout Repo
28-
uses: actions/checkout@v4
29-
- name: Set up Java 17
30-
uses: actions/setup-java@v3
34+
uses: gradle/gradle-build-action@v2.10.0
3135
with:
32-
distribution: adopt
33-
java-version: 17
36+
arguments: build spotlessCheck -Dorg.gradle.parallel=true
3437
cache: gradle
35-
- name: javadoc (JDK 17)
36-
run: ./gradlew --no-daemon clean javadoc

.github/workflows/ci.yml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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

.github/workflows/codeql.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@
1212
name: "CodeQL"
1313

1414
on:
15-
push:
16-
branches: [ main ]
17-
pull_request:
18-
branches: [ main ]
19-
paths-ignore:
20-
- '**/*.json'
21-
- '**/*.md'
22-
- '**/*.properties'
23-
- '**/*.txt'
15+
workflow_call:
2416
jobs:
2517
analyze:
2618
name: Analyze
@@ -60,7 +52,6 @@ jobs:
6052
# Autobuild failed (OOM)
6153
# Hence, supply memory args for gradle build
6254
- run: |
63-
JAVA_OPTS="-Xmx1000M" ./gradlew --no-scan compileJava
64-
55+
JAVA_OPTS="-Xmx2048M" ./gradlew --no-scan compileJava
6556
- name: Perform CodeQL Analysis
6657
uses: github/codeql-action/analyze@v2

.github/workflows/compile.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: compile
2+
on:
3+
workflow_run:
4+
workflows:
5+
- checks
6+
types:
7+
- completed
8+
9+
env:
10+
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false"
11+
12+
jobs:
13+
compile:
14+
runs-on: ubuntu-22.04
15+
timeout-minutes: 30
16+
if: ${{ github.actor != 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success' }}
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@v3
20+
- name: Set up Java
21+
uses: actions/setup-java@v3
22+
with:
23+
distribution: adopt
24+
java-version: 17
25+
cache: gradle
26+
- name: Compile
27+
uses: gradle/gradle-build-action@v2
28+
with:
29+
arguments: build -x test -x spotlessCheck -Dorg.gradle.parallel=true

.github/workflows/dco-merge-group.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)