-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor common code, better requirement management (#1551)
- Loading branch information
Showing
44 changed files
with
10,124 additions
and
1,634 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 |
---|---|---|
@@ -1,21 +1,24 @@ | ||
name: CI | ||
name: Tests | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
tests: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres:13 | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
|
||
|
@@ -24,32 +27,29 @@ jobs: | |
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup Python 3.8 | ||
uses: actions/setup-python@v4 | ||
- name: Setup Python and install dependencies | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
cache: 'pip' | ||
python-version-file: '.python-version' | ||
cache-dependency-path: requirements/test.txt | ||
- run: pip install -r requirements/test.txt | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/test.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements/test.txt | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
|
||
- name: Run Django tests | ||
run: python manage.py test --settings=openstax.settings.test | ||
- name: Check migrations | ||
run: python manage.py makemigrations --check | ||
|
||
- name: Run tests and generate coverage reports | ||
run: coverage run --source '.' manage.py test --settings=openstax.settings.test | ||
env: | ||
SALESFORCE_USERNAME: ${{ secrets.SALESFORCE_USERNAME }} | ||
SALESFORCE_PASSWORD: ${{ secrets.SALESFORCE_PASSWORD }} | ||
SALESFORCE_SECURITY_TOKEN: ${{ secrets.SALESFORCE_SECURITY_TOKEN }} | ||
SOCIAL_AUTH_OPENSTAX_KEY: ${{ secrets.SOCIAL_AUTH_OPENSTAX_KEY }} | ||
SOCIAL_AUTH_OPENSTAX_SECRET: ${{ secrets.SOCIAL_AUTH_OPENSTAX_SECRET }} | ||
- uses: codecov/codecov-action@v3 | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: openstax/openstax-cms | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
3.10.9 | ||
3.11 |
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
35 changes: 35 additions & 0 deletions
35
books/migrations/0154_alter_book_salesforce_abbreviation_and_more.py
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,35 @@ | ||
# Generated by Django 5.0.2 on 2024-02-27 15:58 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("books", "0153_book_polish_site_link"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="book", | ||
name="salesforce_abbreviation", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="This should match the Books Name from Salesforce.", | ||
max_length=255, | ||
null=True, | ||
verbose_name="Subject Book Name", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="book", | ||
name="salesforce_name", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="This is the name shown on interest/adoption forms and used in Partner filtering. The website only shows unique values from here, so it is possible to combine books for forms", | ||
max_length=255, | ||
null=True, | ||
verbose_name="Name displayed on website forms", | ||
), | ||
), | ||
] |
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
Empty file.
Empty file.
12 changes: 0 additions & 12 deletions
12
errata/management/commands/migrate_errata_openstax_books.py
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
errata/management/commands/migrate_errata_user_accounts.py
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
errata/management/commands/populate_errata_accounts_data.py
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.