fix for user-model links, added changelog #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test | |
on: | |
push: | |
branches: [latest] | |
paths: | |
- '**.py' | |
- '.github/workflows/test.yml' | |
- 'requirements_test.txt' | |
pull_request: | |
branches: [latest] | |
paths: | |
- '**.py' | |
- '**.yml' | |
- '.github/workflows/test.yml' | |
- 'requirements_test.txt' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements_test.txt >/dev/null | |
pip install -r requirements_build.txt >/dev/null | |
pip install -r requirements.txt >/dev/null | |
- name: Testing DB migrations for errors (1/3) | |
run: | | |
export AW_DB="/tmp/$(date +%s).e1.aw.db" | |
python3 manage.py makemigrations | |
working-directory: src/ansible-webui/ | |
- name: Testing DB migrations for warnings (1/3) | |
run: | | |
export AW_DB="/tmp/$(date +%s).w1.aw.db" | |
m1=$(python3 manage.py makemigrations 2>&1) | |
if echo "$m1" | grep -q 'WARNING'; then exit 1;fi | |
working-directory: src/ansible-webui/ | |
- name: Testing DB migrations for errors (2/3) | |
run: | | |
export AW_DB="/tmp/$(date +%s).e2.aw.db" | |
python3 manage.py makemigrations aw | |
working-directory: src/ansible-webui/ | |
- name: Testing DB migrations for warnings (2/3) | |
run: | | |
export AW_DB="/tmp/$(date +%s).w2.aw.db" | |
m2=$(python3 manage.py migrate aw 2>&1) | |
if echo "$m2" | grep -q 'WARNING'; then exit 1;fi | |
working-directory: src/ansible-webui/ | |
- name: Testing DB migrations for errors (3/3) | |
run: | | |
export AW_DB="/tmp/$(date +%s).e3.aw.db" | |
python3 manage.py migrate | |
working-directory: src/ansible-webui/ | |
- name: Testing DB migrations for warnings (3/3) | |
run: | | |
export AW_DB="/tmp/$(date +%s).w3.aw.db" | |
m3=$(python3 manage.py migrate 2>&1) | |
if echo "$m3" | grep -q 'WARNING'; then exit 1;fi | |
working-directory: src/ansible-webui/ | |
- name: Testing to start Ansible-WebUI | |
run: | | |
set +e | |
export AW_DB="/tmp/$(date +%s).aw.db" | |
timeout 2 python3 src/ansible-webui | |
ec="$?" | |
if [[ "$ec" != "124" ]] | |
then | |
exit 1 | |
fi | |
- name: Running Tests | |
run: | | |
pytest --version | |
python3 -m pytest |