diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3e83956..1661cd9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: push: branches: [ main ] tags: [ 'v*' ] - pull_request: + pull_request: # if also at push, add "type=ref,event=branch" to docker meta env: JAVA_VERSION: 15 @@ -14,6 +14,10 @@ jobs: lint: runs-on: ubuntu-latest + strategy: + matrix: + system: [ checkstyle, spotbugs, pmd ] + steps: - uses: actions/checkout@v2 @@ -35,23 +39,26 @@ jobs: run: chmod +x gradlew - name: Lint with Gradle - run: ./gradlew checkstyleMain checkstyleTest spotbugsMain spotbugsTest pmdMain pmdTest --stacktrace --no-daemon --refresh-dependencies + run: ./gradlew ${{ matrix.system }}Main ${{ matrix.system }}Test --stacktrace --no-daemon --refresh-dependencies - - name: Annotate Checkstyle Issues + - name: Annotate checkstyle violations + if: matrix.system == 'checkstyle' uses: jwgmeligmeyling/checkstyle-github-action@master with: path: '**/build/reports/checkstyle/*.xml' - - name: Annotate SpotBugs Issues - uses: jwgmeligmeyling/spotbugs-github-action@master - with: - path: '**/build/reports/spotbugs/*.xml' - - - name: Annotate PMD Issues + - name: Annotate pmd violations + if: matrix.system == 'pmd' uses: jwgmeligmeyling/pmd-github-action@master with: path: '**/build/reports/pmd/*.xml' + - name: Annotate spotbugs violations + if: matrix.system == 'spotbugs' + uses: jwgmeligmeyling/spotbugs-github-action@master + with: + path: '**/build/reports/spotbugs/*.xml' + nohttp: runs-on: ubuntu-latest @@ -166,11 +173,10 @@ jobs: tags: | type=edge type=ref,event=pr - type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} flavor: | - prefix=${{ matrix.jvm-impl }} + suffix=-${{ matrix.jvm-impl }} latest=${{ matrix.jvm-impl == 'hotspot' }} - uses: docker/setup-qemu-action@v1 @@ -186,14 +192,14 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} + if: github.event_name != 'pull_request' with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} + if: github.event_name != 'pull_request' with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -223,8 +229,14 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache + - name: Inspect image + if: github.event_name != 'pull_request' + run: | + docker pull ${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.version }} + docker image inspect ${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.version }} + - name: Check manifest - if: ${{ github.event_name != 'pull_request' }} + if: github.event_name != 'pull_request' run: | docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.version }} docker buildx imagetools inspect ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.version }}