-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1290 from archesproject/1263-add-project-tests
Add action to run project tests #1263
- Loading branch information
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: CI | ||
|
||
on: | ||
# push: -- just run on PRs for now | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgis/postgis:13-3.0 | ||
env: | ||
POSTGRES_PASSWORD: postgis | ||
POSTGRES_DB: arches | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- name: Check out arches | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: archesproject/arches | ||
ref: dev/7.5.x | ||
path: arches | ||
|
||
- name: Check out afs | ||
uses: actions/checkout@v2 | ||
with: | ||
path: afs | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install afs | ||
working-directory: afs | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
echo Project installed | ||
- name: Install Java, GDAL, and other system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get install libxml2-dev libpq-dev openjdk-8-jdk libgdal-dev | ||
echo Postgres and ES dependencies installed | ||
- uses: ankane/setup-elasticsearch@v1 | ||
with: | ||
elasticsearch-version: 8 | ||
|
||
- name: Check for missing migrations | ||
working-directory: afs | ||
run: | | ||
PYTHONPATH="../arches" python manage.py makemigrations --check --settings=arches_for_science.test_settings | ||
- name: Run afs unit tests | ||
working-directory: afs | ||
run: | | ||
PYTHONPATH="../arches" python -W default::DeprecationWarning manage.py test --settings=arches_for_science.test_settings |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
|
||
# Depends on /arches being on the python path, as arches.tests is not importable | ||
from tests.test_settings import * | ||
|
||
from arches_for_science.settings import INSTALLED_APPS, ROOT_URLCONF, APP_NAME | ||
APP_ROOT = os.path.dirname(__file__) | ||
|
||
# Further settings may need to be added from project, just don't | ||
# want to clobber anything from core test settings for now. | ||
# Also, settings can be overridden directly. See @override_settings |
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