From 4da538117168ccc748fc5061606b829451c88098 Mon Sep 17 00:00:00 2001 From: Adam Semenenko <152864218+adam-enko@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:58:29 +0200 Subject: [PATCH] Create GitHub Action to check `gradle build` works --- .github/workflows/build-project.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build-project.yml diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml new file mode 100644 index 0000000..1904a03 --- /dev/null +++ b/.github/workflows/build-project.yml @@ -0,0 +1,48 @@ +name: Build Project + +on: + push: + pull_request: + workflow_dispatch: + +concurrency: + group: "Build Project: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + + validate-gradle-wrapper: + runs-on: ubuntu-latest + steps: + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v3 + + + build-gradle: + needs: validate-gradle-wrapper + strategy: + matrix: + include: + - os: [ macos-latest, ubuntu-latest, windows-latest ] + fail-fast: true + runs-on: ${{ matrix.os }} + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref }} + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "21" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_CACHE_ENCRYPTION_KEY }} + + - name: Run tests + run: ./gradlew build --scan --stacktrace