Skip to content

Build and Run Integration Tests Docker #255

Build and Run Integration Tests Docker

Build and Run Integration Tests Docker #255

name: Build and Run Integration Tests Docker
on:
workflow_dispatch:
schedule:
# Every day at the 1am
- cron: '0 1 * * *'
jobs:
publish:
name: Build, Push and Run Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
-
name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
-
name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: docker
file: docker/Dockerfile-tests
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: |
ghcr.io/zaproxy/zaproxy-tests
secrets: |
webswing_url=${{ secrets.WEBSWING_URL }}
annotations: |
index:org.opencontainers.image.source=https://github.com/zaproxy/zaproxy
index:org.opencontainers.image.description=Docker image used for ZAP integration tests.
index:org.opencontainers.image.licenses=Apache-2.0
-
name: Run install tests
id: "test-install"
if: ${{ ! cancelled() }}
run: docker run --rm -t ghcr.io/zaproxy/zaproxy-tests wrk/install_tests.sh
-
name: Run python tests
id: "test-python"
if: ${{ ! cancelled() }}
run: docker run --rm -t ghcr.io/zaproxy/zaproxy-tests wrk/python_tests.sh
-
name: Automation Framework context tests
id: "test-af-context"
if: ${{ ! cancelled() }}
run: docker run --rm -t ghcr.io/zaproxy/zaproxy-tests wrk/af_context_tests.sh
-
name: Automation Framework plan tests
id: "test-af-plan"
if: ${{ ! cancelled() }}
run: docker run --rm -t ghcr.io/zaproxy/zaproxy-tests wrk/af_plan_tests.sh
-
# Run these last as they are most likely to fail
name: Run baseline tests
if: ${{ ! cancelled() }}
run: docker run --rm -t ghcr.io/zaproxy/zaproxy-tests wrk/baseline_tests.sh
- name: "Send messages on failures"
uses: myConsciousness/bluesky-post@96827d0a9604cb228b11b3095f6961196efba4a0 # v5
if: |
! cancelled() && (
steps.test-install.outcome != 'success' ||
steps.test-python.outcome != 'success' ||
steps.test-af-context.outcome != 'success' ||
steps.test-af-plan.outcome != 'success')
with:
text: "Hey @psiinon.bsky.social - looks like the ZAP Integration Tests failed 😟 https://github.com/zaproxy/zaproxy/actions/runs/${{ github.run_id }}"
identifier: ${{ secrets.BLUESKY_ZAPBOT_IDENTIFIER }}
password: ${{ secrets.BLUESKY_ZAPBOT_PASSWORD }}