From a90bd2e4a82f03472ee3846207523396cd7b6fdc Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Sun, 29 Sep 2024 23:43:55 +0530 Subject: [PATCH] github: Add workflow to run lint checks --- .github/workflows/test.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6306cd3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +--- +name: CI Tests + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install poetry + run: pipx install poetry + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + cache: "poetry" + + - name: Install Python dependencies + run: poetry install --no-root --with=dev + + - name: Run linters + run: poetry run ./scripts/lint + + - name: Ensure pyproject.toml and poetry.lock are in sync + run: | + poetry check + + - name: Ensure models and migrations are in sync + run: | + poetry run alembic check