Build and Run Integration Tests Docker #66
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: 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@v4 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push Docker image | |
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.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 }} |