Skip to content

Commit

Permalink
Merge pull request #1355 from gsmet/upload-artifact-v4
Browse files Browse the repository at this point in the history
Update to upload-artifact@v4 and produce job summary
  • Loading branch information
gsmet authored Nov 21, 2024
2 parents 832b5fd + e9384ec commit bd34923
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
- '*.txt'
- '.github/ISSUE_TEMPLATE/**'

defaults:
run:
shell: bash

env:
LANG: en_US.UTF-8
jobs:
Expand All @@ -32,11 +36,10 @@ jobs:
if: github.event_name == 'pull_request'
steps:
- name: Create file
shell: bash
run: |
echo -n ${{ github.event.number }} > pull-request-number
- name: Upload pull request number
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pull-request-number-${{ github.event.number }}
path: pull-request-number
Expand All @@ -56,7 +59,6 @@ jobs:
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
Expand All @@ -72,18 +74,18 @@ jobs:
- name: Build with Maven
run: MAVEN_OPTS=-Xmx4096m && ./mvnw -B clean install --settings .github/mvn-settings.xml --fail-at-end
- name: Delete Local Artifacts From Cache
shell: bash
run: rm -rf ~/.m2/repository/io/quarkus/quarkus-universe-bom*
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: "build-reports-Build - JDK ${{ matrix.java }}"
name: "build-reports-${{ github.run_attempt }}-Build - JDK ${{ matrix.java }}"
path: |
**/target/*-reports/TEST-*.xml
target/build-report.json
LICENSE
retention-days: 2

refresh:
name: Check generated project has been updated
runs-on: ubuntu-latest
Expand All @@ -94,7 +96,6 @@ jobs:
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
Expand All @@ -113,17 +114,36 @@ jobs:
- name: Get changes
id: get-changes
run: |
echo "::set-output name=changes::$(git status -s | wc -l)"
shell: bash
echo "changes=$(git status -s | wc -l)" >> $GITHUB_OUTPUT
- name: Display changes
run: |
git status
git --no-pager diff
shell: bash
- name: Check that generated project is properly updated
uses: actions/github-script@v7
if: ${{ steps.get-changes.outputs.changes > 0 }}
with:
script: |
throw new Error('Generated project needs an update. Please run ./mvnw -Dsync and include the result in your pull request.')
build-report:
runs-on: ubuntu-latest
name: Build report
needs: [build, refresh]
if: always()
steps:
- uses: actions/download-artifact@v4
with:
path: build-reports-artifacts
pattern: "build-reports-${{ github.run_attempt }}-*"
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Produce report and add it as job summary
uses: quarkusio/action-build-reporter@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
build-reports-artifacts-path: build-reports-artifacts

0 comments on commit bd34923

Please sign in to comment.