Skip to content

Commit 8c24196

Browse files
committed
Add workflow for running unittests
Signed-off-by: lelia <lelia@socket.dev>
1 parent 03dc039 commit 8c24196

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/python-tests.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: python-tests
2+
3+
env:
4+
PYTHON_VERSION: "3.12"
5+
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- "socketsecurity/**/*.py"
11+
- "tests/unit/**/*.py"
12+
- "pyproject.toml"
13+
- "uv.lock"
14+
- ".github/workflows/python-tests.yml"
15+
pull_request:
16+
paths:
17+
- "socketsecurity/**/*.py"
18+
- "tests/unit/**/*.py"
19+
- "pyproject.toml"
20+
- "uv.lock"
21+
- ".github/workflows/python-tests.yml"
22+
workflow_dispatch:
23+
24+
permissions:
25+
contents: read
26+
27+
concurrency:
28+
group: python-tests-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
python-tests:
33+
runs-on: ubuntu-latest
34+
timeout-minutes: 20
35+
steps:
36+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
37+
with:
38+
fetch-depth: 1
39+
persist-credentials: false
40+
- name: 🐍 setup python
41+
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
42+
with:
43+
python-version: ${{ env.PYTHON_VERSION }}
44+
- name: 🛠️ install deps
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install uv
48+
uv sync
49+
- name: 🧪 run tests
50+
run: uv run pytest -q tests/unit/

0 commit comments

Comments
 (0)