deps: Update a huge range of dependencies and fix issues for server migration #1602
Workflow file for this run
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: Package checks | |
on: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: [ main, dev ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
db_service: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: uobtheatre_api | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
steps: | |
# Set up cache for pip packages | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
# Checkout the code | |
- uses: actions/checkout@v2 | |
# Setup python | |
- name: set up python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
# Install dependencies | |
- name: Install dependencies | |
run: pip install -r requirements/local.txt | |
# Collect static | |
- name: Collect Static | |
run: ./manage.py collectstatic --noinput | |
- name: Tests | |
run: | | |
pytest --cov uobtheatre --cov-fail-under 100 -m "not system_test" | |
env: | |
DATABASE_URL: postgresql://postgres:[email protected]:5432/uobtheatre_api | |
- name: System tests | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
run: | | |
pytest --cov uobtheatre -m "system_test" | |
env: | |
DATABASE_URL: postgresql://postgres:[email protected]:5432/uobtheatre_api | |
SQUARE_ACCESS_TOKEN: ${{ secrets.SQUARE_SANDBOX_ACCESS_TOKEN }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
# Set up cache for pip packages | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
# Checkout the code | |
- uses: actions/checkout@v2 | |
# Setup python | |
- name: set up python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10.6" | |
# Install dependencies | |
- name: Install dependencies | |
run: pip install -r requirements/local.txt | |
- name: black - formatting | |
run: | | |
black uobtheatre | |
- name: isort - sort imports | |
run: | | |
isort uobtheatre | |
- name: pylint - linting | |
run: | | |
pylint uobtheatre | |
- name: mypy - static type checking | |
run: | | |
mypy uobtheatre | |
# Check migrations have been made | |
- name: Ensure migrations have been generated | |
run: python manage.py makemigrations --check | |
schema: | |
runs-on: ubuntu-latest | |
steps: | |
# Set up cache for pip packages | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
# Checkout the code | |
- uses: actions/checkout@v2 | |
# Setup python | |
- name: set up python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
# Install dependencies | |
- name: Install dependencies | |
run: pip install -r requirements/local.txt | |
# Generate schmea | |
- name: Generate schema | |
run: | | |
./manage.py graphql_schema --schema uobtheatre.schema.schema --out schema.graphql | |
# Push up the schema | |
- name: Commit schema | |
uses: EndBug/[email protected] | |
with: | |
message: 'Updated schema' | |
author_name: github-actions | |
author_email: 41898282+github-actions[bot]@users.noreply.github.com |