-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 2.53 KB
/
Copy pathci.yml
File metadata and controls
87 lines (73 loc) · 2.53 KB
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
84
85
86
87
name: CI
on:
push:
branches: [ main, feat/* ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
build_liboqs:
description: Build liboqs from source before running tests
required: false
default: false
type: boolean
jobs:
test:
runs-on: ubuntu-latest
env:
OQS_INSTALL_PATH: /usr/local
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libssl-dev pkg-config
- name: Optionally build liboqs
if: github.event_name == 'workflow_dispatch' && inputs.build_liboqs || vars.BUILD_LIBOQS == 'true'
run: |
git clone --depth 1 https://github.com/open-quantum-safe/liboqs.git /tmp/liboqs
mkdir -p /tmp/liboqs/build && cd /tmp/liboqs/build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j$(nproc)
sudo make install
sudo ldconfig
python -m pip install liboqs-python
- name: Install Python deps
run: |
python -m pip install --upgrade pip
pip install -r prototype/requirements.txt
pip install bandit safety pre-commit
- name: Run security scan (Bandit)
run: |
bandit -r prototype/ -f json -o bandit-report.json
echo "Bandit report saved to bandit-report.json"
- name: Check for vulnerable dependencies (Safety)
run: |
safety check --json > security-report.json || true
echo "Safety report saved to security-report.json"
- name: Run pre-commit hooks
run: |
pre-commit install
pre-commit run --all-files
- name: Run tests
run: |
pytest -q prototype/test_security_fixes.py prototype/test_oqs_hybrid.py prototype/test_secure_hybrid_integration.py prototype/test_concurrency_smoke.py prototype/test_secure_run.py -v
- name: Upload security reports
uses: actions/upload-artifact@v3
with:
name: security-reports
path: |
bandit-report.json
security-report.json
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker images
run: |
docker-compose -f docker-compose.dev.yml build