Skip to content

add: add a development environment #7

add: add a development environment

add: add a development environment #7

Workflow file for this run

name: Lint and Check Code
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache.outputs.cache-hit }}
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync
mypy:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Run mypy
run: |
uv run mypy . --strict
flake8:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Run flake8
run: |
uv run flake8 .
black:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Run black check
run: |
uv run black --check .
id: black_check
isort:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Run isort check
run: |
uv run isort --check-only .
pytest:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Run pytest
run: |
uv run pytest .