-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (77 loc) · 2.57 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
on:
pull_request:
paths:
- .github/workflows/tests.yml
- safeguards/**
- pyproject.toml
- tests/**
jobs:
lint:
name: check linting using ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
# test-secrets-guardrail:
# name: test secrets guardrail
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - run: |
# pip install -U pip
# pip install torch --index-url https://download.pytorch.org/whl/cpu
# pip install -e ".[dev]"
# python -m pytest -s tests/test_secrets_detection.py
test-privilege-escalation:
name: test privilege escalation guardrail
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- uses: actions/checkout@v4
- run: |
pip install -U pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[dev]"
python -m pytest -s tests/test_privilege_escalation.py
test-prompt-injection-llm:
name: test prompt injection llm guardrail
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- uses: actions/checkout@v4
- run: |
pip install -U pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[dev]"
python -m pytest -s tests/test_prompt_injection_llm.py
test-prompt-injection-classifier:
name: test prompt injection classifier guardrail
runs-on: ubuntu-latest
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
steps:
- uses: actions/checkout@v4
- run: |
pip install -U pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[dev]"
huggingface-cli login --token ${{ secrets.HF_TOKEN }}
python -m pytest -s tests/test_prompt_injection_classifier.py
test-sourcecode-detection-classifier:
name: test sourcecode detection guardrail
runs-on: ubuntu-latest
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
steps:
- uses: actions/checkout@v4
- run: |
pip install -U pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[dev]"
huggingface-cli login --token ${{ secrets.HF_TOKEN }}
python -m pytest -s tests/test_sourcecode_detection.py