initial commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Two distinct steps: | |
# 1st: build and install it with reuired Java LTS and Maven | |
# 2nd: matrix(java, maven) run tests w/ artifacts built in 1st step | |
# | |
# To achieve this, we use short lived cache that shares 1st build output with 2nd | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ github.sha }} | |
- run: ./mvnw install -e -B -V | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
java: ['8', '11', '17'] | |
maven: ['3.9.5', '3.8.8'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ github.sha }} | |
- run: ./mvnw -Dmaven=${{ matrix.maven }} wrapper:wrapper | |
- run: ./mvnw -f demo install -e -B -V | |