Added required details for CORS #574
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: Django Testing | |
on: [push] | |
jobs: | |
test-and-lint: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.7] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pipenv run python -m pip install -U pip | |
pipenv install --dev --ignore-pipfile | |
- name: Setup Postgresql database | |
run: | | |
sudo apt-get update | |
sudo apt-get install postgresql | |
sudo service postgresql start | |
sudo -u postgres psql -c "CREATE DATABASE study_buffalo;" -U postgres | |
sudo -u postgres psql -c "CREATE USER study_buffalo WITH PASSWORD 'study_buffalo';" -U postgres | |
sudo -u postgres psql -c "ALTER ROLE study_buffalo SET client_encoding TO 'utf8';" -U postgres | |
sudo -u postgres psql -c "ALTER ROLE study_buffalo SET default_transaction_isolation TO 'read committed';" -U postgres | |
sudo -u postgres psql -c "ALTER ROLE study_buffalo SET timezone TO 'UTC';" -U postgres | |
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE study_buffalo TO study_buffalo;" -U postgres | |
sudo -u postgres psql -c "ALTER USER study_buffalo CREATEDB;" -U postgres | |
- name: Collect static files | |
run: | | |
cp config/settings/.study_buffalo.env config/settings/study_buffalo.env | |
pipenv run python manage.py collectstatic --no-input | |
- name: Run tests | |
run: | | |
pipenv run pytest --cov study_buffalo --cov-report xml | |
- name: Submit test coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
files: ./reports/coverage.xml | |
flags: unittests | |
name: studybuffalo-coverage | |
fail_ci_if_error: true | |
verbose: true | |
- name: Run linters | |
run: | | |
pipenv run pylint study_buffalo/ config/ | |
pipenv run pycodestyle study_buffalo/ config/ |