Skip to content

Commit c998636

Browse files
committed
Add QA tests workflow
1 parent 3dc4610 commit c998636

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/Dockerfile.qa

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.13.2 AS builder
2+
3+
ENV PYTHONUNBUFFERED=1 \
4+
PYTHONDONTWRITEBYTECODE=1
5+
WORKDIR /app
6+
7+
RUN python -m venv .venv
8+
9+
COPY requirements.txt ./
10+
11+
# Copy the dev firewall package
12+
COPY aikido_zen-*.whl ./
13+
14+
# === THIS SECTION IS MODIFIED FOR QA STEP ===
15+
RUN .venv/bin/pip install -r requirements.txt && \
16+
.venv/bin/pip uninstall -y aikido-zen && \
17+
.venv/bin/pip install ./aikido_zen-*.whl
18+
# === END OF MODIFIED SECTION ===
19+
20+
FROM python:3.13.2-slim
21+
WORKDIR /app
22+
RUN apt update && apt install -y gdb procps
23+
COPY --from=builder /app/.venv .venv/
24+
COPY . .
25+
ENV AIKIDO_BLOCK="1"
26+
CMD ["/app/.venv/bin/gunicorn", "--bind=[::]:8080", "--access-logfile=-", "--workers=4", "wsgi:app"]

.github/workflows/qa-tests.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 🧪 QA Tests
2+
permissions:
3+
contents: read
4+
on:
5+
push: {}
6+
workflow_call: {}
7+
8+
jobs:
9+
qa-tests:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 30
12+
steps:
13+
- name: Checkout firewall-python
14+
uses: actions/checkout@v5
15+
with:
16+
path: firewall-python
17+
18+
- name: Checkout zen-demo-python
19+
uses: actions/checkout@v5
20+
with:
21+
repository: Aikido-demo-apps/zen-demo-python
22+
path: zen-demo-python
23+
ref: dev-testing
24+
submodules: true
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.13"
30+
31+
- name: Install poetry
32+
run: pip install poetry
33+
34+
- name: Build firewall-python dev package
35+
run: |
36+
cd firewall-python
37+
make build
38+
39+
# Move the built wheel to zen-demo-python directory
40+
# poetry build creates both .tar.gz and .whl, we only need the wheel
41+
mv dist/*.whl ../zen-demo-python/
42+
43+
- name: Replace Dockerfile with QA version
44+
run: |
45+
cp firewall-python/.github/workflows/Dockerfile.qa zen-demo-python/Dockerfile
46+
47+
- name: Run Firewall QA Tests
48+
uses: AikidoSec/firewall-tester-action@releases/v1
49+
with:
50+
dockerfile_path: ./zen-demo-python/Dockerfile
51+
app_port: 8080
52+
sleep_before_test: 10

0 commit comments

Comments
 (0)