Create flow for automating byte-buddy version bump #117
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
name: Test all the things | |
on: | |
push: | |
pull_request: | |
issue_comment: | |
types: [ created ] | |
permissions: | |
checks: write | |
pull-requests: read | |
contents: read | |
jobs: | |
ci: | |
if: (github.event.issue.pull_request && contains(github.event.comment.body, 'please rerun tests')) || !github.event.issue | |
runs-on: ubuntu-latest | |
name: Java ${{ matrix.java }} | |
strategy: | |
matrix: | |
java: [ 8, 11, 17, 21 ] | |
fail-fast: false | |
steps: | |
- name: Get PR branch | |
uses: xt0rted/pull-request-comment-branch@v2 | |
id: comment-branch | |
if: github.event.issue.pull_request | |
- uses: actions/checkout@v3 | |
if: (!github.event.issue) | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ steps.comment-branch.outputs.head_ref }} | |
if: github.event.issue.pull_request | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
cache: 'gradle' | |
- name: Test | |
run: | | |
# Conditionally run different commands based on the Java version | |
if [[ "${{ matrix.java }}" == "8" ]]; then | |
./gradlew wrapper --gradle-version=8.4-rc-1 :agent:spec && ./gradlew wrapper --gradle-version=8.4-rc-1 agent:publishToMavenLocal | |
else | |
./travis-test.sh | |
fi | |
- name: Report status | |
if: github.event.issue.pull_request | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/$GITHUB_REPOSITORY/check-runs \ | |
-f "name=Test all the things / Java ${{ matrix.java }}" -f "head_sha=${{ steps.comment-branch.outputs.head_ref }}" -f "status=completed" \ | |
-f "output[title]=Requested test" -f "conclusion=success" -f "target_url=https://github.com/$GITHUB_REPOSITORY/actions/runs/${{ github.run_id }}" -f "output[summary]=Manually triggered test succeeded" |