diff --git a/.github/workflows/junit.yml b/.github/workflows/junit.yml new file mode 100644 index 000000000..a89d6b326 --- /dev/null +++ b/.github/workflows/junit.yml @@ -0,0 +1,41 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: JUnit with Maven + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Java JDK + uses: actions/setup-java@v4.2.1 + with: + java-version: '17' + distribution: 'adopt' + + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Run JUnit Tests + run: mvn test