Skip to content

DeepTeam is a framework to red team LLMs and AI agents.

Add CI and CD workflows for testing and package distribution.

Serghei Iakovlev90165ec71544
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
new file mode 100644
index 00000000..6cdac40b
--- /dev/null
+++ b/.github/workflows/cd.yml
@@ -0,0 +1,60 @@
+name: CD
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+jobs:
+ build:
+ name: Build package
+ runs-on: ubuntu-latest
+
+ # The maximum number of minutes to let a workflow run
+ # before GitHub automatically cancels it. Default: 360
+ timeout-minutes: 30
+
+ strategy:
+ # When set to true, GitHub cancels
+ # all in-progress jobs if any matrix job fails.
+ fail-fast: false
+
+ matrix:
+ python:
+ - '3.10'
+ - '3.11'
+ - '3.12'
+ - '3.13'
+
+ concurrency:
+ # Cancel any currently running job or workflow in the same concurrency group.
+ # The group is a unique identifier for the workflow run.
+ #
+ # Explanation:
+ # - github.workflow: The name of the workflow (e.g. Workflow 1).
+ # - github.event.pull_request.number: The number of the pull request (when the trigger event is a PR).
+ # - github.ref: The branch name (when the trigger is not a PR but a push).
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Install uv + Python ${{ matrix.python }}
+ id: setup-uv
+ uses: astral-sh/setup-uv@v6
+ with:
+ python-version: ${{ matrix.python }}
+ enable-cache: true
+ activate-environment: true
+ cache-dependency-glob: |
+ **/pyproject.toml
+ **/uv.lock
+
+ - name: Install dependencies
+ run: uuv sync --locked --group build
+
+ - name: Build package distribution
+ run: uv build
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..278c06d5
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,66 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+env:
+ PYTHONUNBUFFERED: "1"
+
+jobs:
+ test:
+ name: Run tests
+ runs-on: ubuntu-latest
+
+ # The maximum number of minutes to let a workflow run
+ # before GitHub automatically cancels it. Default: 360
+ timeout-minutes: 30
+
+ strategy:
+ # When set to true, GitHub cancels
+ # all in-progress jobs if any matrix job fails.
+ fail-fast: false
+
+ matrix:
+ python:
+ - '3.10'
+ - '3.11'
+ - '3.12'
+ - '3.13'
+
+ concurrency:
+ # Cancel any currently running job or workflow in the same concurrency group.
+ # The group is a unique identifier for the workflow run.
+ #
+ # Explanation:
+ # - github.workflow: The name of the workflow (e.g. Workflow 1).
+ # - github.event.pull_request.number: The number of the pull request (when the trigger event is a PR).
+ # - github.ref: The branch name (when the trigger is not a PR but a push).
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Install uv + Python ${{ matrix.python }}
+ id: setup-uv
+ uses: astral-sh/setup-uv@v6
+ with:
+ python-version: ${{ matrix.python }}
+ enable-cache: true
+ activate-environment: true
+ cache-dependency-glob: |
+ **/pyproject.toml
+ **/uv.lock
+
+ - name: Install dependencies
+ run: uv sync --locked --group dev
+
+ - name: Run unit tests with coverage
+ run: uv run --frozen pytest
diff --git a/.github/workflows/install_package.yaml b/.github/workflows/install_package.yaml
deleted file mode 100644
index 3edc413d..00000000
--- a/.github/workflows/install_package.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: 'Test_package'
-
-on:
- pull_request:
- push:
-
-jobs:
-
- uv-install:
-
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v4
- - name: Install uv
- uses: astral-sh/setup-uv@v4
- - run: uv sync
- - run: uv build
- - run: uv run pytest