Skip to content

Commit c8fd61b

Browse files
Merge pull request #238 from AikidoSec/add-zen-qa
Add firewall-tester-action to run on every commit
2 parents 6ed09e9 + 33d924f commit c8fd61b

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

.github/workflows/Dockerfile.qa

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Build stage
2+
FROM gradle:7.6.1-jdk17 AS builder
3+
4+
# Install make
5+
RUN apt-get update && apt-get install -y make
6+
7+
# Set working directory
8+
WORKDIR /app
9+
10+
# Copy your source code, including Makefile
11+
COPY . .
12+
13+
# Run make download
14+
# --- modified part ---
15+
RUN mkdir zen_by_aikido
16+
RUN mv zen_dist zen_by_aikido/zen
17+
# --- end modified part ---
18+
RUN make build
19+
20+
# Runtime stage
21+
FROM eclipse-temurin:17
22+
23+
# Install make and postgresql-client
24+
RUN apt-get update && \
25+
apt-get install -y make postgresql-client && \
26+
rm -rf /var/lib/apt/lists/*
27+
28+
# Set working directory
29+
WORKDIR /app
30+
31+
# Copy the built application and SQL file from builder stage
32+
COPY --from=builder /app .
33+
COPY database.sql /app/database.sql
34+
35+
# Create startup script
36+
COPY start.sh /app/start.sh
37+
RUN chmod 755 /app/start.sh
38+
39+
ENTRYPOINT ["/app/start.sh"]

.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-java
14+
uses: actions/checkout@v5
15+
with:
16+
path: firewall-java
17+
18+
- name: Checkout zen-demo-java
19+
uses: actions/checkout@v5
20+
with:
21+
repository: Aikido-demo-apps/zen-demo-java
22+
path: zen-demo-java
23+
ref: qa-test
24+
submodules: true
25+
26+
- name: Set up JDK 21
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '21'
30+
distribution: 'temurin'
31+
32+
- name: Build with Gradle
33+
working-directory: ./firewall-java
34+
run: |
35+
chmod +x gradlew
36+
make binaries
37+
make build
38+
39+
# Move the build jars to demo app
40+
mv dist ../zen-demo-java/zen_dist
41+
42+
- name: Replace Dockerfile with QA version
43+
run: |
44+
cp firewall-java/.github/workflows/Dockerfile.qa zen-demo-java/Dockerfile
45+
46+
- name: Run Firewall QA Tests
47+
uses: AikidoSec/[email protected]
48+
with:
49+
dockerfile_path: ./zen-demo-java/Dockerfile
50+
app_port: 8080
51+
sleep_before_test: 30
52+
skip_tests: test_ssrf,test_stored_ssrf,test_demo_apps_generic_tests

0 commit comments

Comments
 (0)