Skip to content

build: bump actions/upload-pages-artifact from 1 to 2 #241

build: bump actions/upload-pages-artifact from 1 to 2

build: bump actions/upload-pages-artifact from 1 to 2 #241

Workflow file for this run

name: CI
on:
- pull_request
- push
- workflow_dispatch
env:
JDK_VERSION: "19"
WORKSPACE_ARCHIVE: workspace.tar
WORKSPACE_ARTIFACT: build-results
jobs:
validate-gradle:
name: Validate Gradle wrapper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
build:
name: Build
needs: [validate-gradle]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: ${{ env.JDK_VERSION }}
- name: Gradle Assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble -Psnapshot --info -S --show-version
gradle-home-cache-cleanup: true
- name: Tar files
run: tar -cvf ${{ env.WORKSPACE_ARCHIVE }} .
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WORKSPACE_ARTIFACT }}
path: ${{ env.WORKSPACE_ARCHIVE }}
retention-days: 1
mkdocs:
name: Build documentation
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/download-artifact@v3
with:
name: ${{ env.WORKSPACE_ARTIFACT }}
path: .
- name: Untar
run: |
tar -xvf ${{ env.WORKSPACE_ARCHIVE }}
rm ${{ env.WORKSPACE_ARCHIVE }}
- name: Setup Python
uses: actions/setup-python@v4
- name: Install dependencies
run: pip3 install --no-deps -r .github/workflows/mkdocs-requirements.txt
- name: Gradle MkDocs
uses: gradle/gradle-build-action@v2
with:
arguments: mkdocs --info -S --show-version
gradle-home-cache-cleanup: true
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./build/mkdocs/site
retention-days: 3
check:
name: Check
strategy:
matrix:
jdk: [ 8, 11, 17, 20 ]
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/download-artifact@v3
with:
name: ${{ env.WORKSPACE_ARTIFACT }}
path: .
- name: Untar
run: |
tar -xvf ${{ env.WORKSPACE_ARCHIVE }}
rm ${{ env.WORKSPACE_ARCHIVE }}
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: ${{ env.JDK_VERSION }}
- name: Gradle Check
uses: gradle/gradle-build-action@v2
with:
arguments: check -Psnapshot --info -S --show-version -Ptoolchain.test.version=${{ matrix.jdk }}
gradle-home-cache-cleanup: true
# So, what's happening here?
#
# Basically, restoring the workspace state between jobs is incredibly annoying.
# We can get reasonable support by using the upload-/download-artifact
# actions, but they suffer from a severe limitation:
# GH Actions has a storage limit and the minimum retention is 24 hours...
#
# Since the storage quota is limited, we have to make sure that the artifact
# is removed. Unfortunately, there is no official way to do this, so we resort
# to a third party action for now.
#
# See also: https://github.com/actions/upload-artifact/issues/290
cleanup:
name: Cleanup
if: ${{ always() }}
needs: [check]
runs-on: ubuntu-latest
steps:
- name: Cleanup
uses: GeekyEggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af
with:
name: ${{ env.WORKSPACE_ARTIFACT }}