forked from hyperledger/besu
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from jflo/gha_testReportPermissions
Gha test report permissions
- Loading branch information
Showing
27 changed files
with
594 additions
and
542 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -11,14 +11,14 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4.1.1 | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4.0.0 | ||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: setup gradle | ||
uses: gradle/gradle-build-action@v2.12.0 | ||
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa | ||
- name: hadoLint_openj9-jdk_17 | ||
run: docker run --rm -i hadolint/hadolint < docker/openj9-jdk-17/Dockerfile | ||
- name: hadoLint_openjdk_17 | ||
|
@@ -55,33 +55,33 @@ jobs: | |
echo "ARCH=arm64" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4.1.1 | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: short sha | ||
id: shortSha | ||
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Set up Java | ||
uses: actions/setup-java@v4.0.0 | ||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: setup gradle | ||
uses: gradle/gradle-build-action@v2.12.0 | ||
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa | ||
- name: install goss | ||
run: | | ||
mkdir -p docker/reports | ||
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.4.4/goss-${{ steps.prep.outputs.PLATFORM_PAIR }} -o ./docker/tests/goss-${{ steps.prep.outputs.PLATFORM_PAIR }} | ||
- name: build and test docker | ||
uses: gradle/[email protected] | ||
env: | ||
architecture: ${{ steps.prep.outputs.ARCH }} | ||
with: | ||
arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Prelease.releaseVersion=${{ github.ref_name }} | ||
- name: login to ghcr | ||
uses: docker/login-action@v3.0.0 | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: build and test docker | ||
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa | ||
env: | ||
architecture: ${{ steps.prep.outputs.ARCH }} | ||
with: | ||
arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Prelease.releaseVersion=${{ github.ref_name }} | ||
- name: publish | ||
env: | ||
architecture: ${{ steps.prep.outputs.ARCH }} | ||
|
@@ -94,16 +94,16 @@ jobs: | |
packages: write | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4.1.1 | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4.0.0 | ||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: setup gradle | ||
uses: gradle/gradle-build-action@v2.12.0 | ||
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa | ||
- name: login to ghcr | ||
uses: docker/login-action@v3.0.0 | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ github.actor }} | ||
|
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 |
---|---|---|
|
@@ -9,63 +9,36 @@ env: | |
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" | ||
|
||
jobs: | ||
shouldRun: | ||
name: checks to ensure we should run | ||
authorize: | ||
environment: | ||
${{ github.event_name == 'pull_request_target' && | ||
github.event.pull_request.head.repo.full_name != github.repository && | ||
'external' || 'internal' }} | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
shouldRun: ${{steps.shouldRun.outputs.result}} | ||
steps: | ||
- name: required check | ||
id: shouldRun | ||
uses: actions/[email protected] | ||
env: | ||
# fun fact, this changes based on incoming event, it will be different when we run this on pushes to main | ||
RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
with: | ||
script: | | ||
const { RELEVANT_SHA } = process.env; | ||
const { data: { statuses } } = await github.rest.repos.getCombinedStatusForRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: RELEVANT_SHA, | ||
}); | ||
const intTested = statuses && statuses.filter(({ context }) => context === 'integration-tests'); | ||
const alreadyRun = intTested && intTested.find(({ state }) => state === 'success') > 0; | ||
const { data: reviews } = await github.rest.pulls.listReviews({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.issue.number, | ||
}); | ||
const approvingReviews = reviews && reviews.filter(review => review.state === 'APPROVED'); | ||
const shouldRun = !alreadyRun && github.actor != 'dependabot[bot]' && (approvingReviews.length > 0); | ||
console.log("tests should be run = %j", shouldRun); | ||
console.log("alreadyRun = %j", alreadyRun); | ||
console.log("approvingReviews = %j", approvingReviews.length); | ||
return shouldRun; | ||
- run: true | ||
integration-tests: | ||
runs-on: ubuntu-22.04 | ||
needs: shouldRun | ||
if: ${{ needs.shouldRun.outputs.shouldRun == 'true' }} | ||
needs: authorize | ||
permissions: | ||
statuses: write | ||
checks: write | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/[email protected] | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||
- name: Set up Java | ||
uses: actions/setup-java@v4.0.0 | ||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: setup gradle | ||
uses: gradle/gradle-build-action@v2.12.0 | ||
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa | ||
- name: run integration tests | ||
run: ./gradlew integrationTest compileJmh -Dorg.gradle.parallel=true -Dorg.gradle.caching=true | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 | ||
if: (success() || failure()) | ||
with: | ||
report_paths: '**/build/test-results/integrationTest/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
Oops, something went wrong.