-
Notifications
You must be signed in to change notification settings - Fork 5
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 #528 from rcpch/staging
Staging
- Loading branch information
Showing
273 changed files
with
23,512 additions
and
4,735 deletions.
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
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
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,80 @@ | ||
name: Temp workflow to test Pytest Suite | ||
|
||
on: | ||
push: | ||
branches: | ||
- "add-cicd-auto-pytest" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
# this 'env' refers to environment variables | ||
env: | ||
DJANGO_CSRF_TRUSTED_ORIGINS: https://localhost,https://0.0.0.0 | ||
E12_POSTGRES_DB_HOST: 127.0.0.1 | ||
E12_POSTGRES_DB_NAME: test_db | ||
E12_POSTGRES_DB_PASSWORD: postgis | ||
E12_POSTGRES_DB_PORT: 5432 | ||
E12_POSTGRES_DB_USER: postgis | ||
POSTCODES_IO_API_URL: https://api.postcodes.io | ||
RCPCH_CENSUS_PLATFORM_TOKEN: ${{ secrets.RCPCH_CENSUS_PLATFORM_TOKEN }} | ||
RCPCH_CENSUS_PLATFORM_URL: https://api.rcpch.ac.uk/deprivation/v1 | ||
RCPCH_HERMES_SERVER_URL: http://rcpch-hermes.uksouth.azurecontainer.io:8080/v1/snomed | ||
|
||
# this 'environment' refers to GitHub Environments, not environment variables | ||
environment: | ||
name: "development" | ||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
|
||
services: | ||
postgis: | ||
image: postgis/postgis:15-3.3 | ||
env: | ||
POSTGRES_USER: postgis | ||
POSTGRES_PASSWORD: postgis | ||
POSTGRES_DB: test_db | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgis container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: List all files | ||
run: ls -al | ||
|
||
- name: Set up Python version | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install PostGIS dependencies | ||
run: sudo apt-get install -y binutils libproj-dev gdal-bin libgdal-dev python3-gdal | ||
|
||
- name: Create and start virtual environment | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
# python dependencies | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# run migrations | ||
- name: Run migrations | ||
run: python manage.py migrate | ||
|
||
- name: collect static files | ||
run: python manage.py collectstatic --noinput | ||
|
||
# Run Pytest Suite | ||
- name: print settings for debugging purposes | ||
run: python manage.py diffsettings --all | ||
|
||
- name: Pytest Suite | ||
run: pytest -rP |
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ services: | |
- DEBUG=True | ||
- DJANGO_ALLOWED_HOSTS=0.0.0.0 | ||
- DJANGO_CSRF_TRUSTED_ORIGINS=https://localhost,https://0.0.0.0 | ||
- POSTCODES_IO_API_URL=https://api.postcodes.io/postcodes | ||
- POSTCODES_IO_API_URL=https://api.postcodes.io | ||
- RCPCH_CENSUS_PLATFORM_URL=https://api.rcpch.ac.uk/deprivation/v1 # live | ||
# - RCPCH_CENSUS_PLATFORM_URL=http://0.0.0.0:8001 # development | ||
- RCPCH_HERMES_SERVER_URL=http://rcpch-hermes.uksouth.azurecontainer.io:8080/v1/snomed | ||
|
@@ -43,15 +43,15 @@ services: | |
command: > | ||
sh -c "python manage.py collectstatic --noinput && | ||
python manage.py migrate && | ||
python manage.py seed --mode=seed_dummy_cases && | ||
python manage.py seed --mode=cases --cases 100 && | ||
python manage.py seed --mode=seed_registrations && | ||
python manage.py seed --mode=seed_groups_and_permissions && | ||
python manage.py createsuperuser --noinput && | ||
echo 'DEV SETUP SCRIPT: Development superuser email: [email protected]' && | ||
echo 'DEV SETUP SCRIPT: Development superuser password: pw' && | ||
python manage.py runserver 0.0.0.0:8000" | ||
# db container - runs postgres | ||
# db container - runs postgis | ||
db: | ||
image: postgis/postgis:15-3.3 | ||
volumes: | ||
|
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
Oops, something went wrong.