Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Hotfix for upstream dependency's incompatibility with Django 4.1 (#31)
Browse files Browse the repository at this point in the history
* Hotfix for upstream dependency's incompatibility with Django 4.1

* Add check for collecting static assets

* Linting

* Update setup python action

* Swap install order

* Deployment should fail if any step in post compile fails

* Remove poetry cache attempt, reorder steps

* Use just instead

I love testing with github actions!
  • Loading branch information
AetherUnbound authored Nov 5, 2022
1 parent 7b1958e commit 8c1733b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10.4
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.10.4
- name: Run image
- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.2.1
Expand All @@ -33,14 +33,29 @@ jobs:
poetry run python manage.py migrate
poetry run python manage.py netlify_build
test_static_assets:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: extractions/setup-just@v1
- name: Build image
run: just build
- name: Test Collect Static Checks
run: |
just manage collectstatic --no-input
just manage assets build
lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10.4
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.10.4
- uses: pre-commit/[email protected]
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ WORKDIR /app
COPY poetry.lock poetry.lock
COPY pyproject.toml pyproject.toml
RUN poetry install --no-interaction --no-ansi

# HOTFIX FOR https://github.com/miracle2k/django-assets/issues/102
RUN sed -i "s/requires_system_checks = False/requires_system_checks = []/" \
$(poetry show -v 2> /dev/null | head -n1 | cut -d ' ' -f 3)/lib/python3.10/site-packages/django_assets/management/commands/assets.py
1 change: 1 addition & 0 deletions bin/post_compile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# File path should be ./bin/post_compile
# (.sh extension added in Gist just to enable shell syntax highlighting.
# https://discussion.heroku.com/t/django-automaticlly-run-syncdb-and-migrations-after-heroku-deploy-with-a-buildpack-or-otherwise/466/7
set -e

echo "=> Building Static Files..."
python manage.py collectstatic --noinput
Expand Down

0 comments on commit 8c1733b

Please sign in to comment.