diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc804e7..fe836f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,40 @@ name: CI on: [ push, pull_request ] jobs: build: + if: github.ref_name != 'main' && github.base_ref != 'main' && !startsWith(github.ref_name, 'release/') + runs-on: ubuntu-latest + strategy: + matrix: + jdk: [ 11, 17, 21 ] + include: + - jdk: 21 + analysis: true + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.jdk }} + distribution: 'temurin' + - name: Compile + run: ./mvnw -B clean compile + - name: Test (Unit) + run: ./mvnw -B -P coverage verify + - name: Analysis + if: matrix.analysis + run: > + ./mvnw -B sonar:sonar + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.organization=stklcode-github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + build-with-it: + if: github.ref_name == 'main' || github.base_ref == 'main' || startsWith(github.ref_name, 'release/') runs-on: ubuntu-latest strategy: matrix: @@ -24,7 +58,6 @@ jobs: - name: Compile run: ./mvnw -B clean compile - name: Set up Vault - if: github.ref_name == 'main' || github.base_ref == 'main' || startsWith(github.ref_name, 'release/') run: | wget -q "https://releases.hashicorp.com/vault/${{ matrix.vault }}/vault_${{ matrix.vault }}_linux_amd64.zip" wget -q -O - "https://releases.hashicorp.com/vault/${{ matrix.vault }}/vault_${{ matrix.vault }}_SHA256SUMS" | grep linux_amd64 | sha256sum -c @@ -34,13 +67,9 @@ jobs: sudo mv "$tmp/vault" /usr/bin/vault rm -rf "$tmp" - name: Test (Unit & Integration) - if: github.ref_name == 'main'|| github.base_ref == 'main' || startsWith(github.ref_name, 'release/') env: VAULT_VERSION: ${{ matrix.vault }} run: ./mvnw -B -P coverage -P integration-test verify - - name: Test (Unit) - if: github.ref_name != 'main' && github.base_ref != 'main' && !startsWith(github.ref_name, 'release/') - run: ./mvnw -B -P coverage verify - name: Analysis if: matrix.analysis run: >