-
Notifications
You must be signed in to change notification settings - Fork 8
35 lines (35 loc) · 1.5 KB
/
missing-migration-check.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
---
# yamllint disable rule:line-length
name: Missing migration check
# yamllint disable-line rule:truthy
on:
push:
paths:
- .github/scripts/create_config_file.sh
- .github/scripts/mysql_local_setup.sh
- .github/scripts/python_setup.sh
- .github/workflows/missing-migration-check.yml
- 'server/camcops_server/**'
jobs:
migration-check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Missing migration check
run: |
set -eux -o pipefail
${GITHUB_WORKSPACE}/.github/scripts/mysql_local_setup.sh
${GITHUB_WORKSPACE}/.github/scripts/python_setup.sh
source ${HOME}/venv/bin/activate
python -m pip install pymysql
export CAMCOPS_CONFIG_FILE="${HOME}/camcops.cfg"
${GITHUB_WORKSPACE}/.github/scripts/create_config_file.sh
camcops_server upgrade_db --config ${CAMCOPS_CONFIG_FILE}
python ${GITHUB_WORKSPACE}/server/tools/create_database_migration.py test
echo Checking if files generated by create_database_migration.py need to be checked in
git update-index --refresh
git diff-index --quiet HEAD --
test -z "$(git ls-files --exclude-standard --others)"