Add gradle support to the workshop #979
Workflow file for this run
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build_java17: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: Microservices build with Maven | |
| run: mvn -B install --file quarkus-workshop-super-heroes/pom.xml | |
| - name: Report microservices test results | |
| if: always() | |
| uses: ./.github/actions/test-reporter | |
| with: | |
| report-path: quarkus-workshop-super-heroes | |
| report-name: 'Microservices Test Results' | |
| - name: Upload microservices test results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: microservices-test-results | |
| path: '**/target/surefire-reports/TEST-*.xml' | |
| retention-days: 7 | |
| - name: Native build with Maven | |
| run: mvn -B install --file quarkus-workshop-super-heroes/pom.xml -Pnative -Dquarkus.native.container-build=true -DskipITs -pl '!:rest-narration,!:extension-version' | |
| docs: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [ "all","linux","mac","windows" ] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ hashFiles('**/pom.xml') }} | |
| - name: Site generation prep | |
| run: | | |
| sudo apt-get install graphviz | |
| export BASE_URL=`curl -Ls -o /dev/null -w %{url_effective} -I ${GITHUB_REPOSITORY_OWNER}.github.io` | |
| - name: Install Playwright | |
| run: | | |
| cd quarkus-workshop-super-heroes/docs | |
| mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.classpathScope=test -D exec.args="install --with-deps --only-shell chromium" | |
| - name: Build and test site | |
| run: | | |
| cd quarkus-workshop-super-heroes/docs | |
| mvn package -Dos=${{ matrix.os }} | |
| - name: Report site build test results | |
| if: always() | |
| uses: ./.github/actions/test-reporter | |
| with: | |
| report-path: quarkus-workshop-super-heroes/docs/target/surefire-reports | |
| report-name: 'Site Build Test Results (${{ matrix.os }})' | |
| - name: Publishing fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.os }}-fragments | |
| path: ./quarkus-workshop-super-heroes/docs/target/generated-asciidoc | |
| if-no-files-found: error | |
| retention-days: 3 | |
| publication: | |
| needs: [ docs ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download default site | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: all-fragments | |
| path: target/generated-asciidoc | |
| # take the all- package to be the top-level | |
| - name: Download Linux site | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: linux-fragments | |
| path: target/generated-asciidoc/linux | |
| - name: Download Mac site | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: mac-fragments | |
| path: target/generated-asciidoc/mac | |
| - name: Download Windows site | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: windows-fragments | |
| path: target/generated-asciidoc/windows | |
| - name: Site assembly | |
| run: | | |
| # aggregate the fragments | |
| # Take just the contents of the variants folders for the other platforms | |
| cp -r target/generated-asciidoc/linux/variants/* target/generated-asciidoc/variants | |
| cp -r target/generated-asciidoc/mac/variants/* target/generated-asciidoc/variants | |
| cp -r target/generated-asciidoc/windows/variants/* target/generated-asciidoc/variants | |
| # Remove the OS-specific directories now that their variants are merged | |
| rm -rf target/generated-asciidoc/linux | |
| rm -rf target/generated-asciidoc/mac | |
| rm -rf target/generated-asciidoc/windows | |
| # Move things around to preserve the super-heroes structure | |
| mkdir -p target/site/super-heroes | |
| cp -R target/generated-asciidoc/* target/site/super-heroes | |
| # Move the redirect.html page to the root | |
| cp target/generated-asciidoc/redirect.html target/site/index.html | |
| - name: Store PR id | |
| if: "github.event_name == 'pull_request'" | |
| run: echo ${{ github.event.number }} > ./target/site/pr-id.txt | |
| - name: Publishing directory for PR preview | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: site | |
| path: ./target/site | |
| retention-days: 3 | |
| test-docs: | |
| needs: [ publication ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ hashFiles('**/pom.xml') }} | |
| - name: Download assembled site | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: site | |
| path: target/site | |
| - name: Install Playwright | |
| run: | | |
| cd quarkus-workshop-super-heroes/docs | |
| mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.classpathScope=test -D exec.args="install --with-deps --only-shell chromium" | |
| - name: Run documentation tests | |
| run: | | |
| cd quarkus-workshop-super-heroes/docs | |
| mvn test -Ddocs.base.path=../../target/site/super-heroes | |
| - name: Report documentation test results | |
| if: always() | |
| uses: ./.github/actions/test-reporter | |
| with: | |
| report-path: quarkus-workshop-super-heroes/docs/target/surefire-reports | |
| report-name: 'Documentation Test Results' | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results | |
| path: quarkus-workshop-super-heroes/docs/target/surefire-reports | |
| retention-days: 7 | |
| deploy: | |
| if: "github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'schedule')" | |
| needs: [ publication, test-docs, build_java17 ] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download Built site | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: site | |
| path: site | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |