Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub actions to use Gradle #3451

Merged
merged 125 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
d3bda85
Update build to use gradle
rbair23 May 23, 2022
a86d1df
Add besu repo
rbair23 May 23, 2022
3453918
Make besu repo more widely available
rbair23 May 23, 2022
8d0f3c4
WIP: Try a different build pipeline
rbair23 May 24, 2022
6153a74
WIP: Try a different build pipeline
rbair23 May 24, 2022
f3c5f23
WIP: Try master as the branch name
rbair23 May 24, 2022
138de22
Checkout for each job
rbair23 May 24, 2022
7537d8e
Remove setup
rbair23 May 24, 2022
7643c19
Remove Circle CI
rbair23 May 24, 2022
9a6985f
Remove Circle CI
rbair23 May 24, 2022
04fa71b
Merge remote-tracking branch 'origin/master' into 03374-add-the-gradl…
rbair23 May 24, 2022
d844bef
WIP
rbair23 May 24, 2022
8e4176a
WIP: Upload code coverage
rbair23 May 24, 2022
58d242c
WIP: Fix paths to jacoco files
rbair23 May 24, 2022
642961f
WIP: Upload test results
rbair23 May 24, 2022
d621d80
WIP: Add javadoc
rbair23 May 24, 2022
cfbd321
WIP: Try new path syntax
rbair23 May 24, 2022
681f76d
WIP: Try surefire reporter
rbair23 May 24, 2022
9ac33b2
WIP: Try a few others
rbair23 May 25, 2022
3648cba
WIP: Settle on surefire reporting
rbair23 May 25, 2022
c5d1fbf
WIP: Don't fail if test results are not found.
rbair23 May 25, 2022
da0dfd8
WIP: Grrr... something is wrong
rbair23 May 25, 2022
5a7ba4a
WIP: Try dorny again
rbair23 May 25, 2022
cc1ec7d
WIP: Try dorny again
rbair23 May 25, 2022
583f56f
WIP: Try another one
rbair23 May 25, 2022
d0a5a30
WIP: Try adding jacoco and codecov uploading with no details
rbair23 May 25, 2022
96d79ef
WIP: Update badges on readme
rbair23 May 25, 2022
1474f74
WIP: Add in sonarqube
rbair23 May 25, 2022
1d4ebe7
WIP: No shallow clones for sonar
rbair23 May 25, 2022
b572f84
WIP: Remove vestiges of circle ci
rbair23 May 25, 2022
9ebac9a
WIP: Remove vestiges of circle ci and add sonar props
rbair23 May 25, 2022
acd375d
WIP: Remove sonar project key
rbair23 May 25, 2022
eebd1c6
WIP: Try similar scripts to platform
rbair23 May 25, 2022
4d7b06b
WIP: Use ubuntu-latest for now
rbair23 May 25, 2022
6a2200b
WIP: Remote pgsql, create integration tests
rbair23 Jun 1, 2022
efdcbb6
WIP: Merge from master
rbair23 Jun 1, 2022
fb62af7
WIP: Start local network before integration tests
rbair23 Jun 1, 2022
22ef3c4
WIP: Cannot use 'w' flag with cut on linux
rbair23 Jun 1, 2022
8708a2e
WIP: Use self-hosted runner
rbair23 Jun 1, 2022
b5e6d23
WIP: Add Circle CI back in
rbair23 Jun 15, 2022
d27b842
WIP: Let config.yml for circle CI match master
rbair23 Jun 15, 2022
b72d3db
WIP: Bring back more of circle ci config
rbair23 Jun 15, 2022
8b7dcfd
WIP: Add executable flag to files
rbair23 Jun 15, 2022
1bd7715
WIP: Use testcontainers for itest
rbair23 Jun 15, 2022
c22d194
Updates GHA workflows to run on Kube runners
nathanklick Jun 16, 2022
cf813d3
Adds manual build workflow
nathanklick Jun 16, 2022
9ac4d47
Intentionally break the new workflow definition
nathanklick Jun 16, 2022
3c1c4ba
Revert "Intentionally break the new workflow definition"
nathanklick Jun 16, 2022
80f19e1
Remove the owasp analysis with clause
nathanklick Jun 16, 2022
5012dd0
Standardize workflow
nathanklick Jun 16, 2022
0fb9b41
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 17, 2022
9fb4b96
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 23, 2022
2827ad4
Fix warning with unit test reporting
nathanklick Jun 23, 2022
1623c36
Added additional maven repository
nathanklick Jun 23, 2022
11af917
Fix merge issues
nathanklick Jun 23, 2022
83b5a7f
Fix javadoc
nathanklick Jun 23, 2022
0535a48
Attempted fix for multiple panels
nathanklick Jun 23, 2022
fee170a
Fix conditions in workflow
nathanklick Jun 23, 2022
cf0126b
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 24, 2022
ab176da
Fixes subsequent test classes and prevents failures
nathanklick Jun 24, 2022
51cd1d9
Fix the maven build
nathanklick Jun 24, 2022
38eec46
Fix Sonar analysis
nathanklick Jun 24, 2022
c25a897
Attempt to resolve new failures manifest in subsequent test classes d…
nathanklick Jun 24, 2022
e17ccea
Clean up imports
nathanklick Jun 24, 2022
efa7ab2
Declare throws on beforeAll and stop wrapping the TimeoutException in…
nathanklick Jun 24, 2022
7fa353c
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 26, 2022
94e874b
Ensure nodes are restarted after a class finishes
nathanklick Jun 26, 2022
7129e7f
Use a JUnit5 extension instead of the JUnit5 class rule
nathanklick Jun 27, 2022
2893d62
Update the default version in the docker-compose .env file
nathanklick Jun 27, 2022
d850e1f
Introduce a network config folder
nathanklick Jun 27, 2022
6d8510f
Revert ParallelIntegrationTests back to concurrent execution mode in …
nathanklick Jun 27, 2022
8a9162e
Attempted fixes for inter-class failures
nathanklick Jun 27, 2022
bf212a4
Capture additional diagnostic data
nathanklick Jun 27, 2022
fb938ed
Capture additional diagnostics
nathanklick Jun 28, 2022
3119e89
Added additional diagnostic capture
nathanklick Jun 28, 2022
4579236
Capture more explicit information
nathanklick Jun 28, 2022
8adf052
Attempted to fix inter-class execution errors
nathanklick Jun 28, 2022
d8aeb88
Updated to Platform SDK 0.27.1
nathanklick Jun 28, 2022
a38c931
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 28, 2022
fd59d7b
Fix archive folder naming
nathanklick Jun 28, 2022
7cc3019
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 28, 2022
e9dcb01
Fix inter-class integration test failures
nathanklick Jun 28, 2022
9254ac0
Ensure multi-node networks wait for all containers to be created and …
nathanklick Jun 29, 2022
26256c9
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 29, 2022
05fefd6
Fixes Sonar warnings
nathanklick Jun 29, 2022
282848d
Fix regression in TopicUpdateSuite
nathanklick Jun 29, 2022
67c07d3
Resolves sonar issues reported in the HapiApiSpec class
nathanklick Jun 29, 2022
3fbdbd1
Resolves concerns from PR comments
nathanklick Jun 29, 2022
1632e24
Fixes additional SonarCloud issues
nathanklick Jun 29, 2022
238e877
Resolve additional sonar reports
nathanklick Jun 29, 2022
b9059cb
Additional fixes
nathanklick Jun 29, 2022
376bb4a
Clean up some additional issues
nathanklick Jun 30, 2022
a779248
Fix more sonar issues
nathanklick Jun 30, 2022
95260ab
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jun 30, 2022
3954334
Fixed and applied spotless
nathanklick Jun 30, 2022
a0c95a5
Undo copyrights busted by spotless
nathanklick Jul 1, 2022
68deb20
Fix spotless license header application
nathanklick Jul 1, 2022
acff601
Fix spotless to properly strip the old license header
nathanklick Jul 1, 2022
cea4cfe
Fix spotless to properly strip old license headers and have Sonar/Cod…
nathanklick Jul 1, 2022
164e73d
Apply spotless formatting - now correct
nathanklick Jul 1, 2022
948344a
Updates the comments
nathanklick Jul 1, 2022
2778c76
Add suppression clauses for two SonarCloud warnings
nathanklick Jul 1, 2022
4407cdb
Apply spotless fixes
nathanklick Jul 1, 2022
a16a956
Adds EET support for GHA and uses multiple concurrent jobs
nathanklick Jul 1, 2022
71e54e3
Fix error in action workflow
nathanklick Jul 1, 2022
0b28623
Remove duplicate CI jobs hitting sonar cloud
nathanklick Jul 1, 2022
770237e
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jul 1, 2022
d5afa12
Disable upload from CCI for CodeCov and Sonar
nathanklick Jul 1, 2022
f9d7fbd
Fix EET test suite
nathanklick Jul 1, 2022
0514087
Apply spotless to the suite
nathanklick Jul 1, 2022
37076d4
Attempt to aggregate sonar analysis and coverage
nathanklick Jul 1, 2022
75efbe8
Fixes sonarqube analysis issues
nathanklick Jul 1, 2022
68f97a2
Fix for sonar
nathanklick Jul 1, 2022
2a2df8d
Fix for failing test
nathanklick Jul 1, 2022
2b12edd
Fix spotless and really fix the test this time for sure (maybe)
nathanklick Jul 1, 2022
d785139
Fix E2E panel (again, hopefully)
nathanklick Jul 1, 2022
07b96e2
Apply spotless
nathanklick Jul 1, 2022
3627282
Fix sonar code smells
nathanklick Jul 1, 2022
c1d5e98
Spotless fights back
nathanklick Jul 1, 2022
9c1d93e
Force use of git history for license headers
nathanklick Jul 6, 2022
5498d6a
Merge branch 'master' into 03374-add-the-gradle-build-to-the-github-w…
nathanklick Jul 6, 2022
019899f
Fix for extra space after license header
nathanklick Jul 6, 2022
bd3a3c7
Reformat code to fix license header
nathanklick Jul 6, 2022
35a84aa
Fix branch & manual workflow
nathanklick Jul 6, 2022
8f2e1e9
Change defaults
nathanklick Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1440,24 +1440,24 @@ workflows:
ignore:
- NONE
workflow-name: "Continuous-integration"
- sonar-check:
context: SonarCloud
requires:
- artifact-build
workflow-name: "Continuous-integration-GCP"
# - sonar-check:
# context: SonarCloud
# requires:
# - artifact-build
# workflow-name: "Continuous-integration-GCP"

- build-platform-and-services:
context: SonarCloud
requires:
- artifact-build
workflow-name: "Continuous-integration-GCP"
- javadoc-generation:
context: Slack
requires:
- build-platform-and-services
pre-steps:
- attach_workspace:
at: /
# - javadoc-generation:
# context: Slack
# requires:
# - build-platform-and-services
# pre-steps:
# - attach_workspace:
# at: /
- jrs-regression:
context: Slack
regression_path: /swirlds-platform/regression/assets
Expand All @@ -1469,7 +1469,7 @@ workflows:
slack_results_channel: "hedera-cicd"
slack_summary_channel: "hedera-cicd"
requires:
- javadoc-generation
- build-platform-and-services
pre-steps:
- install-tools
- attach_workspace:
Expand Down Expand Up @@ -1501,7 +1501,7 @@ jobs:
name: mvn install
# use double quote otherwise the backslash of line continuation will be treated as part of mvn parameter
command: |
mvn --no-transfer-progress -Dsonar.branch.name=${CIRCLE_BRANCH} -Dsonar.login=${SONAR_TOKEN} clean install sonar:sonar \
mvn --no-transfer-progress clean install \
| tee /repo/test-clients/output/hapi-client.log
- run:
name: Save Unit Test Results
Expand All @@ -1519,12 +1519,12 @@ jobs:
- store_artifacts:
path: ~/junit

- run:
name: Upload codecov
command: |
apt update -y
apt install -y curl
bash <(wget -O - https://codecov.io/bash)
# - run:
# name: Upload codecov
# command: |
# apt update -y
# apt install -y curl
# bash <(wget -O - https://codecov.io/bash)
- persist_to_workspace:
root: /
paths:
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ hedera-node/data/lib/
hedera-node/data/recordstreams/
hedera-node/data/accountBalances/
hedera-node/data/saved/
hedera-node/databases/
hedera-node/target/
hedera-node/output/
test-clients/target/
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TAG=v0.11.0-493-g8f79ba46b-dirty
TAG=0.28.0-SNAPSHOT
REGISTRY_PREFIX=
43 changes: 0 additions & 43 deletions .github/workflows/build.yml

This file was deleted.

217 changes: 217 additions & 0 deletions .github/workflows/comp-compile-application-code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
name: "ZComponent: Compile"
on:
workflow_call:
inputs:
enable-javadoc:
description: "Javadoc Enabled:"
type: boolean
required: false
default: true
enable-unit-tests:
description: "Unit Testing Enabled:"
type: boolean
required: false
default: false
enable-e2e-tests:
description: "End to End Testing Enabled:"
type: boolean
required: false
default: false
enable-integration-tests:
description: "Integration Testing Enabled:"
type: boolean
required: false
default: false
enable-sonar-analysis:
description: "Sonar Analysis Enabled:"
type: boolean
required: false
default: false
java-distribution:
description: "Java JDK Distribution:"
type: string
required: false
default: "temurin"
java-version:
description: "Java JDK Version:"
type: string
required: false
default: "17.0.3"
custom-job-label:
description: "Custom Job Label:"
type: string
required: false
default: "Compiles"

secrets:
access-token:
description: "The Github access token used to checkout the repository, submodules, and make GitHub API calls."
required: true
sonar-token:
description: "The SonarCloud access token used by the SonarQube agent to report an analysis."
required: false

defaults:
run:
shell: bash

permissions:
id-token: write
actions: write
pull-requests: write
statuses: write
checks: write
contents: read

jobs:
compile:
name: ${{ inputs.custom-job-label || 'Compiles' }}
runs-on: [self-hosted, Linux, services, standard, ephemeral]
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Expand Shallow Clone for SonarQube
if: ${{ inputs.enable-sonar-analysis && !cancelled() }}
run: |
git fetch --unshallow --no-recurse-submodules

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}

- name: Compile
id: gradle-build
uses: gradle/gradle-build-action@v2
with:
arguments: assemble

- name: Javadoc
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-javadoc && !cancelled() }}
with:
arguments: javadoc

- name: Unit Testing
id: gradle-test
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-unit-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
arguments: check

- name: Publish Unit Test Report
uses: mikepenz/action-junit-report@v3
if: ${{ inputs.enable-unit-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
check_name: Unit Test Results
report_paths: "**/build/test-results/test/TEST-*.xml"
require_tests: 'false'

- name: Build Docker Image # build the image for hedera-node
if: ${{ (inputs.enable-integration-tests || inputs.enable-e2e-tests) && steps.gradle-build.conclusion == 'success' && !cancelled() }}
run: bash compose-build.sh

- name: Integration Testing
id: gradle-itest
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-integration-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
arguments: itest

- name: Publish Integration Test Report
uses: mikepenz/action-junit-report@v3
if: ${{ inputs.enable-integration-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
check_name: Integration Test Results
report_paths: "**/build/test-results/itest/TEST-*.xml"
require_tests: 'false'

- name: E2E Testing
id: gradle-eet
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-e2e-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
arguments: eet

- name: Publish E2E Test Report
uses: mikepenz/action-junit-report@v3
if: ${{ inputs.enable-e2e-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
check_name: E2E Test Results
report_paths: "**/build/test-results/eet/TEST-*.xml"
require_tests: 'false'

- name: Jacoco Coverage Report
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-unit-tests && !cancelled() }}
with:
arguments: jacocoTestReport

- name: Publish To Codecov
if: ${{ inputs.enable-unit-tests && !cancelled() }}
uses: codecov/codecov-action@v3

# - name: Publish Code Coverage Data
# uses: actions/upload-artifact@v3
# if: ${{ inputs.enable-unit-tests && !cancelled() }}
# with:
# name: Jacoco Data
# path: "**/build/reports/jacoco/test/jacocoTestReport.xml"

- name: Publish Test Reports
uses: actions/upload-artifact@v3
if: ${{ inputs.enable-unit-tests && !cancelled() }}
with:
name: Test Reports
path: "**/build/reports/tests/**"

# - name: Show Integration Test Folder Structures
# if: ${{ always() }}
# run: |
# if ! command -v tree >/dev/null 2>&1; then
# echo "::group::Install Tree Command"
# sudo apt update
# sudo apt install -y tree
# echo "::endgroup::"
# fi
#
# echo "::group::Show Network Folder Contents"
# tree -apshug "${{ github.workspace }}/test-clients/build/network"
# echo "::endgroup::"

- name: Publish Test Network Logs
uses: actions/upload-artifact@v3
if: ${{ (inputs.enable-e2e-tests || inputs.enable-integration-test) && !cancelled() }}
with:
name: Test Network Logs
path: |
test-clients/build/network/**/output/**
test-clients/output/**

- name: SonarCloud Options
id: sonar-cloud
env:
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
if: ${{ inputs.enable-sonar-analysis && steps.gradle-build.conclusion == 'success' && !cancelled() }}
run: |
SONAR_OPTS="-Dsonar.branch.name=${{ github.ref_name }}"
if [[ "${IS_PULL_REQUEST}" == true ]]; then
SONAR_OPTS=""
fi

echo "::set-output name=options::${SONAR_OPTS}"

- name: SonarCloud Scan
uses: gradle/gradle-build-action@v2
env:
GITHUB_TOKEN: ${{ secrets.access-token }}
SONAR_TOKEN: ${{ secrets.sonar-token }}
SONAR_OPTS: ${{ steps.sonar-cloud.outputs.options }}
if: ${{ inputs.enable-sonar-analysis && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
arguments: sonarqube --info
Loading