Skip to content

Commit

Permalink
ci: update ubuntu_workfow to use GITHUB_STEP_SUMMARY instead of posti…
Browse files Browse the repository at this point in the history
…ng comments (#2546)

* ci: update ubuntu_workfow to use GITHUB_STEP_SUMMARY instead of posting comments
* ci: update gradle action
* update to use env when using run
  • Loading branch information
Lyokone authored Nov 21, 2024
1 parent 84c7558 commit 2aa80ca
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 82 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/macos_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- uses: gradle/wrapper-validation-action@v3
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 15
- uses: actions/cache@v4
with:
Expand All @@ -35,10 +36,11 @@ jobs:
restore-keys: |
${{ runner.os }}-2-gradle-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle clean build
uses: gradle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
with:
arguments: "clean build"
run: ./gradlew clean build
37 changes: 18 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,35 @@ jobs:
echo "$GITHUB_SHA" > ./test_runner/src/main/resources/revision.txt
echo "$RELEASE_TAG" > ./test_runner/src/main/resources/version.txt
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle Build Flank
uses: gradle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
with:
arguments: "clean test_runner:build test_runner:shadowJar"
run: ./gradlew clean test_runner:build test_runner:shadowJar

- name: Delete old release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh --version
flankScripts github delete_release --git-tag=$RELEASE_TAG
- name: Delete old tag
if: ${{ env.RELEASE_TAG == 'flank-snapshot' }}
run: flankScripts github delete_old_tag --git-tag=$RELEASE_TAG --username=$GITHUB_ACTOR --token=${{ secrets.GITHUB_TOKEN }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: flankScripts github delete_old_tag --git-tag=$RELEASE_TAG --username=$GITHUB_ACTOR --token="$GH_TOKEN"

- name: Release snapshot
if: ${{ env.RELEASE_TAG == 'flank-snapshot' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: flankScripts github make_release --input-file=./test_runner/build/libs/flank.jar --git-tag=$RELEASE_TAG --commit-hash=$GITHUB_SHA --snapshot

- name: Release stable
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: flankScripts github make_release --input-file=./test_runner/build/libs/flank.jar --git-tag=$RELEASE_TAG --token=${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: flankScripts github make_release --input-file=./test_runner/build/libs/flank.jar --git-tag=$RELEASE_TAG --token="$GH_TOKEN"

- name: Append checksum to release
env:
Expand All @@ -98,22 +97,22 @@ jobs:
gh release upload $RELEASE_TAG flank.sha256
- name: Gradle Upload to MavenCentral
uses: gradle/[email protected]
env:
PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }}
with:
arguments: :test_runner:publishMavenJavaPublicationToMavenCentralRepository -PMVN_CENTRAL_USER=${{ secrets.MVN_CENTRAL_USER }} -PMVN_CENTRAL_PASSWORD=${{ secrets.MVN_CENTRAL_PASSWORD }}
MVN_CENTRAL_USER: ${{ secrets.MVN_CENTRAL_USER }}
PMVN_CENTRAL_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }}
run: ./gradlew :test_runner:publishMavenJavaPublicationToMavenCentralRepository -PMVN_CENTRAL_USER="$MVN_CENTRAL_USER" -PMVN_CENTRAL_PASSWORD="$MVN_CENTRAL_PASSWORD"

- name: Gradle close staging on MavenCentral
uses: gradle/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
arguments: closeAndReleaseRepository -PMVN_CENTRAL_USER=${{ secrets.MVN_CENTRAL_USER }} -PMVN_CENTRAL_PASSWORD=${{ secrets.MVN_CENTRAL_PASSWORD }}
env:
MVN_CENTRAL_USER: ${{ secrets.MVN_CENTRAL_USER }}
MVN_CENTRAL_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }}
run: ./gradlew closeAndReleaseRepository -PMVN_CENTRAL_USER="$MVN_CENTRAL_USER" -PMVN_CENTRAL_PASSWORD="$MVN_CENTRAL_PASSWORD"

- name: Gradle Upload to GitHub packages
uses: gradle/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
env:
PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }}
with:
arguments: ":test_runner:publishMavenJavaPublicationToGitHubPackagesRepository -PGITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :test_runner:publishMavenJavaPublicationToGitHubPackagesRepository -PGITHUB_TOKEN="$GH_TOKEN"
9 changes: 5 additions & 4 deletions .github/workflows/release_flank_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle Upload to Github packages and Github release
uses: gradle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: "flank-scripts:releaseFlankScripts -PGITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew flank-scripts:releaseFlankScripts -PGITHUB_TOKEN="$GH_TOKEN"
9 changes: 5 additions & 4 deletions .github/workflows/release_flank_wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle Upload to Github packages and Github release
uses: gradle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: "flank_wrapper:releaseFlankWrapper -PGITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew flank-wrapper:releaseFlankWrapper -PGITHUB_TOKEN="$GH_TOKEN"
11 changes: 7 additions & 4 deletions .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ jobs:
fi
shell: bash

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle integration tests
uses: gradle/[email protected]
id: run-it
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.ref }}
with:
arguments: "integrationTests"
run: ./gradlew integrationTests

- name: Export Variables for FlankScripts
if: ${{ always() }}
Expand Down Expand Up @@ -117,11 +118,13 @@ jobs:
echo "./flank-scripts/bash" >> $GITHUB_PATH
- name: Process IT results
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
flankScripts integration_tests process_results \
--global-result=${{ needs.run-it-full-suite.outputs.job_status }} \
--run-result='${{ toJSON(env) }}' \
--github-token=${{ secrets.GITHUB_TOKEN }} \
--github-token="$GH_TOKEN" \
--run-id=${{ github.run_id }}
trigger-pointer:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tag_next_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
./gradlew :flank-scripts:download
echo "./flank-scripts/bash" >> $GITHUB_PATH
- name: Set next release tag variable
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=$(flankScripts release next_tag --token=${{ secrets.GITHUB_TOKEN }})
TAG=$(flankScripts release next_tag --token="$GH_TOKEN")
echo "NEXT_RELEASE_TAG=$(echo $TAG)" >> $GITHUB_ENV
- name: Push tag
Expand Down
48 changes: 14 additions & 34 deletions .github/workflows/ubuntu_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- id: build
name: Gradle clean build
uses: gradle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
with:
arguments: "clean build"

run: ./gradlew clean build

publish-scan-url:
needs: [ build ]
needs:
- build
permissions:
pull-requests: write # to allow creating or updating a comment
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -67,34 +69,12 @@ jobs:
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: 'YYYY-MM-DD HH:mm:ss'
format: "YYYY-MM-DD HH:mm:ss"
utcOffset: "+00:00"

- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Buildscan url for ubuntu-workflow run

- name: Create comment
if: ${{ steps.fc.outputs.comment-id == 0 }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
**Timestamp:** ${{ steps.current-time.outputs.formattedTime }}
**Buildscan url for ubuntu-workflow run [${{ github.run_id }}](https://github.com/Flank/flank/actions/runs/${{ github.run_id }})**
${{ needs.build.outputs.build-scan-url }}
- name: Update comment
if: ${{ steps.fc.outputs.comment-id != 0 }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
**Timestamp:** ${{ steps.current-time.outputs.formattedTime }}
**Buildscan url for ubuntu-workflow run [${{ github.run_id }}](https://github.com/Flank/flank/actions/runs/${{ github.run_id }})**
${{ needs.build.outputs.build-scan-url }}
- name: Write Buildscan URL to Summary
run: |
echo "**Timestamp:** ${{ steps.current-time.outputs.formattedTime }}" >> $GITHUB_STEP_SUMMARY
echo "**Buildscan URL for ubuntu-workflow run:**" >> $GITHUB_STEP_SUMMARY
echo "[${{ github.run_id }}](https://github.com/Flank/flank/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
echo "${{ needs.build.outputs.build-scan-url }}" >> $GITHUB_STEP_SUMMARY
11 changes: 7 additions & 4 deletions .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
app_id: ${{ secrets.FLANK_RELEASE_APP_ID }}
private_key: ${{ secrets.FLANK_RELEASE_PRIVATE_KEY }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle dependency updates raport
uses: gradle/[email protected]
with:
arguments: dependencyUpdates -DoutputFormatter=json -DoutputDir=.
run: ./gradlew dependencyUpdates -DoutputFormatter=json -DoutputDir=.

- name: Download flankScripts and add it to PATH
env:
Expand Down Expand Up @@ -117,9 +118,11 @@ jobs:
echo "./flank-scripts/bash" >> $GITHUB_PATH
- name: Run SDK check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
flankScripts firebase check_for_sdk_updates \
--github-token=${{ secrets.GITHUB_TOKEN }} \
--github-token="$GH_TOKEN" \
trigger-pointer:
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/windows_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ jobs:
restore-keys: |
${{ runner.os }}-2-gradle-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle clean build
uses: gradle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
with:
arguments: "clean build"
run: ./gradlew clean build
13 changes: 7 additions & 6 deletions .github/workflows/wsl_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,18 @@ jobs:
GCLOUD_DIR="$HOME/.config/gcloud/"
mkdir -p "$GCLOUD_DIR"
echo "$GCLOUD_KEY" | base64 --ignore-garbage --decode > "$GCLOUD_DIR/application_default_credentials.json"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Gradle Integration Tests Android
uses: gradle/[email protected]
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
with:
arguments: "--info :integration_tests:test --tests IntegrationTests.shouldMatchAndroidSuccessExitCodeAndPattern -Dflank-path=../test_runner/build/libs/flank.jar -Dyml-path=./src/test/resources/flank_android.yml"
run: |
./gradlew --info :integration_tests:test --tests IntegrationTests.shouldMatchAndroidSuccessExitCodeAndPattern -Dflank-path=../test_runner/build/libs/flank.jar -Dyml-path=./src/test/resources/flank_android.yml
- name: Gradle Integration Tests iOS
uses: gradle/[email protected]
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
with:
arguments: "--info :integration_tests:test --tests IntegrationTests.shouldMatchIosSuccessExitCodeAndPattern -Dflank-path=../test_runner/build/libs/flank.jar -Dyml-path=./src/test/resources/flank_ios.yml"
run: |
./gradlew --info :integration_tests:test --tests IntegrationTests.shouldMatchIosSuccessExitCodeAndPattern -Dflank-path=../test_runner/build/libs/flank.jar -Dyml-path=./src/test/resources/flank_ios.yml

0 comments on commit 2aa80ca

Please sign in to comment.