Upgrade github actions versions #9
This file contains hidden or 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 - 4.x-beta | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| versions: | |
| - CONTEXT: . | |
| TAGS: | |
| - wiremock/wiremock:test | |
| PLATFORMS: | |
| - linux/amd64 | |
| - linux/arm64 | |
| - linux/arm/v7 | |
| - CONTEXT: alpine | |
| TAGS: | |
| - wiremock/wiremock:test-alpine | |
| PLATFORMS: | |
| - linux/amd64 | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| image: tonistiigi/binfmt:latest | |
| platforms: all | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Checkout sources | |
| uses: actions/checkout@main | |
| # TODO: Re-enable if rate limit becomes an issues | |
| # - name: Login to Docker Hub | |
| # uses: docker/login-action@v2 | |
| # with: | |
| # username: wiremock | |
| # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Build WireMock Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ${{ matrix.versions.CONTEXT }} | |
| platforms: ${{ join(matrix.versions.PLATFORMS, ',') }} | |
| push: false | |
| file: ${{ matrix.versions.CONTEXT }}/Dockerfile | |
| tags: ${{ matrix.versions.TAGS[0] }} | |
| build-args: | | |
| WIREMOCK_VERSION=4.0.0-beta.29 | |
| - name: Build Wiremock Docker image | |
| run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile --build-arg JAVA_VERSION=17 --build-arg WIREMOCK_VERSION=4.0.0-beta.29 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Run integration test | |
| working-directory: test/integration-tests | |
| run: mvn -B -ntp package verify --file pom.xml -DargLine="-Dit.wiremock-image=${{ matrix.versions.TAGS[0] }}" | |
| - name: Run Snyk to check Docker image for vulnerabilities | |
| uses: snyk/actions/docker@master | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| with: | |
| image: ${{ matrix.versions.TAGS[0] }} | |
| command: test | |
| args: --file=${{ matrix.versions.CONTEXT }}/Dockerfile --severity-threshold=high --fail-on=upgradable --org=f310ee2f-5552-444d-84ee-ec8c44c33adb --policy-path=${{ matrix.versions.CONTEXT }}/.snyk |