Skip to content

Commit

Permalink
Add tox env to validate requirements
Browse files Browse the repository at this point in the history
This will check that our requirements are appropriately compiled.
  • Loading branch information
willbarton committed Dec 4, 2023
1 parent c5630a1 commit 74128b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ on:
workflow_dispatch:
paths:
- '**.py'
- 'requirements/**.txt'
- 'requirements/**.in'
- '**.html'
- '**.mo'
- '**.po'
pull_request:
paths:
- '**.py'
- 'requirements/**.txt'
- 'requirements/**.in'
- '**.html'
- '**.mo'
- '**.po'
merge_group:
paths:
- '**.py'
- 'requirements/**.txt'
- 'requirements/**.in'
- '**.html'
- '**.mo'
- '**.po'
Expand All @@ -34,6 +34,7 @@ jobs:
- validate-migrations
- validate-assets
- validate-translations
- validate-requirements
- unittest

services:
Expand Down
20 changes: 19 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ commands=
# Invoke with: tox -e validate-translations
# Ensure that there are no changes to translatable strings that aren't
# contained in the comitted portable object files.
# This ultimate tests whether the generated django.mo file has changed
# This ultimately tests whether the generated django.mo file has changed
# (the django.po file will change because it includes the date it was
# generated).
# NOTE: Requires gettext. Will overwrite any existing
Expand All @@ -191,6 +191,24 @@ commands=
git diff --quiet */locale/*/LC_MESSAGES/django.mo


[testenv:validate-requirements]
# Invoke with: tox -e validate-requirements
# Ensure that there are no changes to dependencies in our requirements/*.in
# files that haven't been compiled to the requirements/*.txt files.
# NOTE: Will overwrite any existing requirements/*.txt files
recreate=False
envdir={toxworkdir}/unittest
deps=
{[unittest-config]deps}
setenv={[unittest-config]setenv}
allowlist_externals=
./compile-requirements.sh
git
commands=
./compile-requirements.sh
git diff --quiet requirements/*.txt


[testenv:coverage]
# Invoke with: tox -e coverage
# Report out the coverage of changes on the current branch against the main
Expand Down

0 comments on commit 74128b0

Please sign in to comment.