From a1210d44aaa1dfebab753b064b768c55f5e95f20 Mon Sep 17 00:00:00 2001 From: Joaquim d'Souza Date: Fri, 8 Mar 2024 17:11:05 +0100 Subject: [PATCH] fix: github actions --- .github/workflows/lint.yml | 8 +++---- .github/workflows/tests.yml | 43 +++++++++++++------------------------ pyproject.toml | 2 +- 3 files changed, 20 insertions(+), 33 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 70d2d13c8..2cfada1fb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,21 +3,21 @@ name: Lint on: + push: pull_request: - workflow_call: jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: black Lint + - name: Run black uses: psf/black@stable with: options: "--check --diff" src: "." version: "22.8.0" - - name: isort Lint + - name: Run isort uses: isort/isort-action@master - - name: flake8 Lint + - name: Run flake8 uses: py-actions/flake8@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aad36f63e..9295409a9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,41 +11,28 @@ on: jobs: tests: runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 + container: + image: python:3.12 + env: + POETRY_VIRTUALENVS_CREATE: "false" steps: - - name: checkout repo content + - name: Checkout repo content uses: actions/checkout@v2 - + - name: Install poetry + run: curl -sSL https://install.python-poetry.org | python3 - + - name: Install dependencies + run: ~/.local/bin/poetry export --with dev -f requirements.txt --output requirements.txt && pip install -r requirements.txt - name: Run django tests - uses: ./.github/actions/in-container env: DATABASE_URL: postgres://postgres:postgres@postgres/postgres CACHE_FILE: /tmp/meep SECRET_KEY: keyboardcat - with: - run: | - script/bootstrap - script/test --coverage - - # do this inside the docker container otherwise the paths don't work - - name: generate coverage xml - uses: ./.github/actions/in-container - with: - run: coverage xml - - # do this outside the docker container otherwise can't get repo details - - name: upload code coverage + run: | + script/bootstrap + coverage run --source=. --branch manage.py test + - name: Generate coverage xml + run: coverage xml + - name: Upload code coverage run: | less coverage.xml pip install codecov diff --git a/pyproject.toml b/pyproject.toml index 438870289..ab4571a22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ requests-cache = "^0.9.6" Pillow = "^10.2.0" python-magic = "^0.4.27" tqdm = "^4.64.1" +pandas = "^2.2.1" openpyxl = "^3.0.10" mysoc-dataset = "^0.3.0" django-jsonform = "^2.15.0" @@ -34,7 +35,6 @@ whitenoise = "^6.6.0" setuptools = "^69.1.1" uvicorn = "^0.27.1" strawberry-graphql = {extras = ["asgi"], version = "^0.220.0"} -pandas = "^2.2.1" [tool.poetry.dev-dependencies] black = "^22.8.0"