Fix: fix document model #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: validate | |
on: | |
pull_request: | |
branches: [main] | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: true | |
PIP_INDEX_URL: https://mirrors.ustc.edu.cn/pypi/simple | |
PIP_PROGRESS_BAR: off | |
PIP_ROOT_USER_ACTION: ignore | |
jobs: | |
lint-yaml: | |
name: lint workflow yaml | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run yamllint | |
uses: karancode/yamllint-github-action@master | |
with: | |
yamllint_file_or_dir: .github/workflows | |
validate-and-lint: | |
name: Validate and Run Linters | |
runs-on: ubuntu-latest | |
needs: [lint-yaml] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: set up uv | |
uses: astral-sh/setup-uv@v4 | |
- name: create virtual enviroment | |
run: uv venv | |
- name: Install dependencies | |
run: uv sync --group dev --group lint --group security --group typing | |
- name: Run Bandit | |
run: uv run bandit -c pyproject.toml -r . | |
- name: Run mypy | |
run: uv run mypy . | |
- name: Run ruff | |
run: uv run ruff check . | |
- name: Run detect-secrets | |
run: | | |
FILES_TO_SCAN=$(git ls-files -z | xargs -0) | |
uv run detect-secrets-hook \ | |
--baseline .secrets.baseline \ | |
"${FILES_TO_SCAN}" |