From 59fca292ee774ff6be4ee12805b395c831fc247b Mon Sep 17 00:00:00 2001 From: Guillermo Calvo Date: Sat, 15 Jun 2024 18:31:40 +0200 Subject: [PATCH] Add build pipeline --- .github/workflows/build.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2dd07c7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,69 @@ + +# Continuous Integration +name: Build + +on: + push: + branches: + - '*' + pull_request: + branches: + - main + - develop + +jobs: + build: + + name: Build on JDK${{ matrix.jdk }} + runs-on: ubuntu-latest + + strategy: + matrix: + jdk: [ 17, 21 ] + + steps: + + # ================================ + # SHALLOW CLONE + # ================================ + - name: Shallow clone + uses: actions/checkout@v4 + + # ================================ + # VALIDATE GRADLE WRAPPER + # ================================ + - name: Validate Gradle Wrapper files + uses: gradle/actions/wrapper-validation@v3 + + # ================================ + # SET UP JDK + # ================================ + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-package: jdk + java-version: ${{ matrix.jdk }} + + # ================================ + # SET UP GRADLE + # ================================ + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + with: + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes" + cache-read-only: ${{ github.ref_name != 'main' && github.ref_name != 'develop' }} + + # ================================ + # BUILD + # ================================ + - name: Build + run: ./gradlew build -x check + + # ================================ + # CHECK + # ================================ + - name: Check + run: ./gradlew check