Nightly #1314
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: Nightly | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
docker-build-push: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
versions: | |
- CONTEXT: . | |
TAGS: | |
- wiremock/wiremock:nightly | |
- ghcr.io/wiremock/wiremock:nightly | |
PLATFORMS: | |
- linux/amd64 | |
- linux/arm64 | |
- linux/arm/v7 | |
- CONTEXT: alpine | |
TAGS: | |
- wiremock/wiremock:nightly-alpine | |
- ghcr.io/wiremock/wiremock:nightly-alpine | |
PLATFORMS: | |
- linux/amd64 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
if: ${{ matrix.versions.CONTEXT != 'alpine' }} | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Checkout sources | |
uses: actions/checkout@main | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: wiremockio | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: wiremock | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Wiremock Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.versions.CONTEXT }} | |
load: true | |
file: ${{ matrix.versions.CONTEXT }}/Dockerfile-nightly | |
tags: ${{ matrix.versions.TAGS[0] }} | |
- name: Build Wiremock Docker image | |
run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile-nightly | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
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: Test Wiremock Docker image with SSL | |
run: | | |
docker container run -d --name test -p 8443:8443 ${{ matrix.versions.TAGS[0] }} --https-port 8443 | |
timeout 10 bash -c 'while ! curl --fail --insecure https://localhost:8443/__admin/; do sleep 1; done' | |
docker container rm -f test | |
- name: Push Wiremock Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.versions.CONTEXT }} | |
platforms: ${{ join(matrix.versions.PLATFORMS, ',') }} | |
push: true | |
file: ${{ matrix.versions.CONTEXT }}/Dockerfile-nightly | |
tags: ${{ join(matrix.versions.TAGS, ',') }} |