Student context #41
Workflow file for this run
This file contains 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: Run static analysis on the code | |
on: | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# Run ruff to check for code quality | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
uv pip sync --system pyproject.toml | |
uv pip install --system ruff | |
- name: Run ruff | |
run: ruff check . | |
# Run Bandit to check for common security vulnerabilities | |
bandit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
uv pip sync --system pyproject.toml | |
uv pip install --system bandit | |
- name: Run Bandit | |
run: bandit -r . |