-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (39 loc) · 1.27 KB
/
check-migrations-and-messages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Check for up-to-date Django migrations and messages
on: [push, pull_request, workflow_call]
jobs:
check-migrations-and-messages:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y gettext
- uses: actions/setup-python@v5
with:
python-version-file: .github/workflows/.python-version
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install Python dependencies
run: pip install -e .[dev,test]
- name: Run ./bin/makemigrations.sh
run: |
if ./bin/makemigrations.sh | grep -q 'No changes detected';
then
exit 0;
else
exit 1;
fi
- name: Run ./bin/makemessages.sh
run: |
./bin/makemessages.sh
set -x # show commands
git add benefits
# message files are up-to-date if the only differences are from the updated timestamp
if echo $(git diff --cached --shortstat) | grep -q '2 files changed, 2 insertions(+), 2 deletions(-)';
then
exit 0;
else
exit 1;
fi