Skip to content
Open
Show file tree
Hide file tree
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
39 changes: 37 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: run tests

name: CI Pipeline
on: [push, pull_request]

env:
Expand All @@ -8,6 +7,7 @@ env:
DB_PASSWORD: vulnerablecode

jobs:
# Original test job
build:
runs-on: ubuntu-20.04

Expand Down Expand Up @@ -56,3 +56,38 @@ jobs:
VULNERABLECODE_DB_NAME: ${{ env.DB_NAME }}
VULNERABLECODE_DB_USER: ${{ env.DB_USER }}
VULNERABLECODE_DB_PASSWORD: ${{ env.DB_PASSWORD }}



# New job for Docker-based tests
docker-tests:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker Image
run: docker compose build --no-cache

- name: Run Tests in Docker Container
run: |
docker compose up -d
docker compose exec vulnerablecode sh -c "
python3 -m venv venv &&
chmod +x venv &&
. venv/bin/activate &&
pip install -r requirements.txt &&
make test "
env:
GH_TOKEN: 1
POSTGRES_HOST: vulnerablecode-db
POSTGRES_PORT: 5432
VULNERABLECODE_DB_NAME: ${{ env.DB_NAME }}
VULNERABLECODE_DB_USER: ${{ env.DB_USER }}
VULNERABLECODE_DB_PASSWORD: ${{ env.DB_PASSWORD }}

- name: Tear Down Docker Environment
if: always()
run: docker compose down --remove-orphans

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ coreapi==2.3.3
coreschema==0.0.4
cryptography==44.0.1
crispy-bootstrap4==2024.1
cvss
cwe2==3.0.0
dateparser==1.1.1
decorator==5.1.1
Expand All @@ -30,6 +31,7 @@ distro==1.7.0
Django==4.2.20
django-crispy-forms==2.3
django-environ==0.11.2
django-extensions==3.2.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this ?

django-filter==24.3
django-recaptcha==4.0.0
django-widget-tweaks==1.5.0
Expand All @@ -46,6 +48,7 @@ frozenlist==1.3.0
gitdb==4.0.9
GitPython==3.1.41
gunicorn==23.0.0
htmllistparse
idna==3.3
imagesize==1.3.0
importlib-metadata==4.11.3
Expand Down
Loading