Skip to content

Commit

Permalink
fix: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimds committed Mar 11, 2024
1 parent 4d0bde0 commit 5545b96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 19 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,32 @@ jobs:
--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 linux dependencies
run: apt-get update && apt-get install -y binutils gdal-bin libproj-dev
- name: Install poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Install python 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
DATABASE_URL: postgres://postgres:postgres@postgres:5432/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
codecov
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 5545b96

Please sign in to comment.