-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (76 loc) · 2.45 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: EZID CI
on: push
jobs:
tests:
runs-on: ubuntu-latest
env:
IS_CI: 1
DJANGO_SETTINGS_MODULE: settings.tests
PYTHONPATH: ${{ github.workspace }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
- name: Start MySQL service
run: |
sudo /etc/init.d/mysql start
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: pip install .
- name: Install dev dependencies
run: pip install -r requirements-dev.txt
- name: Validate installed packages against poetry.lock file
run: poetry check --lock
- name: Dump environment (for troubleshooting)
run: |
printf 'PYTHONPATH: %s\n' "$PYTHONPATH"
# apt-cache pkgnames | sort
# find / | grep /bin/ | sort
# pip freeze
# pip check || true
# python --version
echo "CWD=${PWD}"
ls -l
# mysql -e '
# use ezid_test_db;
# show tables;
# select prefix, minter from ezidapp_shoulder;
# '
- name: Prepare DB
run: |
mysql -h127.0.0.1 -uroot -proot << EOF
drop database if exists ezid_test_db;
create database ezid_test_db;
use ezid_test_db;
drop user if exists 'ezid_test_user'@'%';
create user 'ezid_test_user'@'%' identified by 'ezid_test_pw';
grant all privileges on ezid_test_db.* to 'ezid_test_user'@'%';
flush privileges;
EOF
- name: Prepare filesystem
run: |
mkdir -p ../download/public ../logs
- name: Setup DB and static files
run: |
# ./manage.py makemigrations --merge --no-input
# ./manage.py makemigrations ezidapp
./manage.py migrate
./manage.py collectstatic --no-input
- name: Load DB fixture
run: |
# ./manage.py loaddata --ignorenonexistent db
./manage.py loaddata db
#./manage.py diag-update-admin
- name: Run tests
env:
PYTHONPATH: ${{ github.workspace }}
run: |
pytest --maxfail 10
# - pip install -e .