From 5df1bd19f6424640b0cabf52eeb9bff9728f3613 Mon Sep 17 00:00:00 2001 From: Vladimir Yussupov Date: Sun, 29 Oct 2023 01:53:13 +0200 Subject: [PATCH] Update CI workflow --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 173bdad..6a5d9aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,56 @@ name: CI -on: [push] +on: [ push ] jobs: - build: + compile: runs-on: ubuntu-latest + name: Running Java ${{ matrix.java }} compile steps: - uses: actions/checkout@v3 + - name: Set up JDK 18 + uses: actions/setup-java@v1 + with: + distribution: 'temurin' + java-version: '17' + cache: maven + - name: Compile code + run: mvn compile + test: + runs-on: ubuntu-latest + name: Run tests + needs: compile + steps: + - uses: actions/checkout@v3 - name: Set up JDK 18 - uses: actions/setup-java@v3 + uses: actions/setup-java@v1 with: distribution: 'temurin' java-version: '17' - cache: 'maven' + cache: maven + - name: Start MongoDB + uses: supercharge/mongodb-github-action@1.10.0 + with: + mongodb-version: '6.0' + - name: Run unit tests + run: mvn test + build: + runs-on: ubuntu-latest + name: Run build + needs: test + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 18 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + cache: maven + - name: Start MongoDB + uses: supercharge/mongodb-github-action@1.10.0 + with: + mongodb-version: '6.0' - name: Build with Maven run: mvn -B package --file pom.xml