From 43f9b6104450068af68593d4231cdfd1c1d0afdd Mon Sep 17 00:00:00 2001 From: Nicklas Lundin Date: Fri, 15 Sep 2023 11:36:26 +0200 Subject: [PATCH] ci: setup initial java PR ci --- .github/workflows/ci-pull-request.yaml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci-pull-request.yaml diff --git a/.github/workflows/ci-pull-request.yaml b/.github/workflows/ci-pull-request.yaml new file mode 100644 index 00000000..79605adc --- /dev/null +++ b/.github/workflows/ci-pull-request.yaml @@ -0,0 +1,37 @@ +name: Java CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + name: Build/Test + + runs-on: ubuntu-latest + + strategy: + matrix: + java_version: [8, 11, 17] + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java_version }} + + - name: Cache Maven packages + uses: actions/cache@v3.3.1 + with: + path: ~/.m2 + key: ${{ runner.os }}-java-${{ matrix.java_version }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-java-${{ matrix.java_version }}-m2 + + - name: Build with Maven + run: mvn --batch-mode --update-snapshots fmt:check verify