Skip to content

Commit 6a7398a

Browse files
committed
chore: add github workflows
1 parent 3a6cb9c commit 6a7398a

File tree

2 files changed

+67
-70
lines changed

2 files changed

+67
-70
lines changed

.github/workflows/validate.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
PIP_DISABLE_PIP_VERSION_CHECK: true
9+
PIP_INDEX_URL: https://mirrors.ustc.edu.cn/pypi/simple
10+
PIP_PROGRESS_BAR: off
11+
PIP_ROOT_USER_ACTION: ignore
12+
13+
jobs:
14+
create-venv:
15+
runs-on: ubuntu-latest
16+
name: Setup Python + uv
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.12
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.12
25+
26+
- name: Install uv and dependencies
27+
run: |
28+
pip install uv
29+
uv venv
30+
uv pip install --group bandit --group mypy --group ruff --group secret
31+
env:
32+
PIP_INDEX_URL: ${{ env.PIP_INDEX_URL }}
33+
34+
- name: Save env variable
35+
run: echo "PYPI_MIRROR=${{ env.PIP_INDEX_URL }}" >> $GITHUB_ENV
36+
37+
bandit:
38+
runs-on: ubuntu-latest
39+
needs: create-venv
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Run bandit
43+
run: .venv/bin/bandit -c pyproject.toml -r .
44+
45+
mypy:
46+
runs-on: ubuntu-latest
47+
needs: create-venv
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Run mypy
51+
run: .venv/bin/mypy .
52+
53+
ruff:
54+
runs-on: ubuntu-latest
55+
needs: create-venv
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Run ruff
59+
run: .venv/bin/ruff check .
60+
61+
secrets:
62+
runs-on: ubuntu-latest
63+
needs: create-venv
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: Run detect-secrets
67+
run: .venv/bin/detect-secrets-hook --baseline .secrets.baseline

.woodpecker/.validate.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)