-
Notifications
You must be signed in to change notification settings - Fork 0
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 #558 from UW-GAC/main
Deploy to stage
- Loading branch information
Showing
10 changed files
with
106 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,31 +20,34 @@ concurrency: | |
|
||
jobs: | ||
|
||
pytest-mariadb: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 2 | ||
matrix: | ||
# While we are only running for a single version | ||
# ahead of planned upgrades we can add versions as | ||
# needed | ||
python-version: [3.8] | ||
mariadb-version: ["10.4", "10.5"] | ||
backend: ["sqlite", "mariadb"] | ||
mariadb-version: ["10.4"] | ||
include: | ||
- python-version: 3.8 # Possible future version. | ||
backend: "mariadb" | ||
mariadb-version: "10.5" | ||
name: "py${{ matrix.python-version }}-${{ matrix.backend }}-${{ matrix.mariadb-version }}" | ||
|
||
services: | ||
mysql: | ||
# Always start mariadb, even if we are testing with the mysql backend. | ||
# Github actions do not allow conditional services yet. | ||
image: mariadb:${{ matrix.mariadb-version }} | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
options: --tmpfs /var/lib/mysql | ||
|
||
env: | ||
# mysql://user:password@host:port/database | ||
DATABASE_URL: "mysql://root:[email protected]:3306/mysql" | ||
# We can set this to an empty string, since we'll never make an API call. | ||
ANVIL_API_SERVICE_ACCOUNT_FILE: foo | ||
|
||
PYTEST_ADDOPTS: "--maxfail=20" # Stop testing after too many failures. | ||
# Conditionally set the database url based on the backend. | ||
DATABASE_URL: ${{ matrix.backend == 'sqlite' && 'sqlite:///db.sqlite3' || 'mysql://root:[email protected]:3306/mysql' }} | ||
|
||
steps: | ||
|
||
|
@@ -69,60 +72,18 @@ jobs: | |
- name: Collect staticfiles | ||
run: python manage.py collectstatic --noinput --settings=config.settings.test | ||
|
||
- name: Run tests | ||
run: coverage run -p -m pytest | ||
env: | ||
# We can set this to an empty string, since we'll never make an API call. | ||
ANVIL_API_SERVICE_ACCOUNT_FILE: foo | ||
|
||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-data-mysql-${{ strategy.job-index }} | ||
path: .coverage.* | ||
|
||
pytest-sqlite: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# We can set this to an empty string, since we'll never make an API call. | ||
ANVIL_API_SERVICE_ACCOUNT_FILE: foo | ||
|
||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
cache: pip | ||
cache-dependency-path: | | ||
requirements/requirements.txt | ||
requirements/test-requirements.txt | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pip-tools | ||
pip-sync requirements/requirements.txt requirements/test-requirements.txt | ||
- name: Collect staticfiles | ||
run: python manage.py collectstatic --noinput --settings=config.settings.test | ||
|
||
- name: Run tests | ||
run: coverage run -p -m pytest | ||
|
||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-data-sqlite-${{ strategy.job-index }} | ||
name: coverage-data-${{ strategy.job-index }} | ||
path: .coverage.* | ||
|
||
coverage: | ||
needs: | ||
- pytest-mariadb | ||
- pytest-sqlite | ||
- test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
|
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
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 |
---|---|---|
|
@@ -15,3 +15,6 @@ MAILTO="[email protected]" | |
10 4 * * SUN . /var/www/django/primed_apps/primed-apps-activate.sh; python manage.py run_dbgap_audit --email [email protected] >> cron.log | ||
15 4 * * SUN . /var/www/django/primed_apps/primed-apps-activate.sh; python manage.py run_cdsa_audit --email [email protected] >> cron.log | ||
20 4 * * SUN . /var/www/django/primed_apps/primed-apps-activate.sh; python manage.py run_collaborative_analysis_audit --email [email protected] >> cron.log | ||
|
||
# Nightly user data audit | ||
0 2 * * * . /var/www/django/primed_apps/primed-apps-activate.sh; python manage.py sync-drupal-data --update --email [email protected] >> cron.log |
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.