forked from UCL-INGI/INGInious
-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (46 loc) · 1.52 KB
/
minfiles_and_i18n_actions.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
name: Check minfiles and i18n
on:
pull_request:
branches:
- master
jobs:
check-minified-files:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-node@v2
with:
node-version: '10.x'
- uses: actions/checkout@v2
- name: Minify and check plugins' minfiles
run: |
npm install
npm run minify
if [[ -n "$(git status -s)" ]]; then
echo "The minfiles in the plugins are not updated. Please update them before merging this.";
exit 1;
fi
working-directory: utils/minify_plugins/
check-i18n-files:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.5.10'
architecture: 'x64'
- name: Install python babel
run: |
sudo apt-get update
sudo apt-get install python-babel
- uses: actions/checkout@v2
- name: Check i18n files
run: |
python3 utils/pybabel/i18n.py --actions extract --repo-path ./
file="inginious/frontend/i18n/es/LC_MESSAGES/messages.po"
inserted="$(git diff --numstat $file | cut -f1)"
inserted=$((inserted + 0))
deleted="$(git diff --numstat $file | cut -f2)"
deleted=$((deleted + 0))
if [ $inserted -gt 2 ] || [ $deleted -gt 2 ]; then
echo "The translation files are not updated. Please update the translations files in inginious/frontend/i18n to merge this PR.";
exit 1;
fi