Skip to content

Commit dd49db2

Browse files
committed
feat: add ci
1 parent 47c8216 commit dd49db2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Github-CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
security-scan:
11+
name: Security Scanning
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Run Secret Scanning with Gitleaks
20+
uses: gitleaks/gitleaks-action@v2
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GH_SECRET_TOKEN }}
23+
24+
- name: Run Python Security Scan with Bandit
25+
run: |
26+
pip install bandit
27+
bandit -r . -ll
28+
29+
test:
30+
name: Run Python Tests
31+
needs: security-scan
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
python-version: ['3.11', '3.12', '3.13']
36+
steps:
37+
- name: Checkout Repository
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 1
41+
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Cache pip dependencies
48+
uses: actions/cache@v3
49+
with:
50+
path: ~/.cache/pip
51+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
52+
restore-keys: |
53+
${{ runner.os }}-pip-
54+
55+
- name: Install Dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install -r requirements.txt
59+
60+
- name: Run Tests and Generate Coverage Report
61+
run: |
62+
pytest --cov=./ --cov-report=xml
63+
64+
- name: Upload Coverage Report
65+
uses: codecov/codecov-action@v3
66+
with:
67+
file: ./coverage.xml

0 commit comments

Comments
 (0)