Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,44 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

# A healthy app answers an unsigned webhook with a 400. If gunicorn can't load
# the app, the container exits and curl gets no response.
- name: Test starting
run: |
docker run -d --name docker-app -p 8080:8080 docker-app
status=$(curl -s -o /dev/null -w '%{http_code}' --retry 15 --retry-delay 1 --retry-all-errors -X POST localhost:8080/ || true)
if [ "$status" != "400" ]; then
echo "Expected a 400 from POST /, got $status"
docker logs docker-app
exit 1
fi
# Not in the required-checks list: a new CVE in the base image fails this job on
# every PR until the image is fixed, and that shouldn't block unrelated merges.
# It still shows as a failed check, so findings stay visible.
image-scan:
name: Image vulnerability scan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1

# Reuses the layers that the Docker build job caches. It only reads the cache,
# so the two jobs don't both write it.
- name: Build
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
load: true
tags: docker-app
cache-from: type=gha

# Fail only on high or critical vulnerabilities that have a fix, such as a newer
# base image or Python release. Most of the base image's OS findings have no fix.
- name: Scan image for vulnerabilities
Expand All @@ -89,18 +127,6 @@ jobs:
# it for updates, instead of downloading it on every run.
cache-db: true

# A healthy app answers an unsigned webhook with a 400. If gunicorn can't load
# the app, the container exits and curl gets no response.
- name: Test starting
run: |
docker run -d --name docker-app -p 8080:8080 docker-app
status=$(curl -s -o /dev/null -w '%{http_code}' --retry 15 --retry-delay 1 --retry-all-errors -X POST localhost:8080/ || true)
if [ "$status" != "400" ]; then
echo "Expected a 400 from POST /, got $status"
docker logs docker-app
exit 1
fi
tests:
name: Unit tests
runs-on: ubuntu-latest
Expand Down
Loading