Skip to content

style: format code with Black and isort #1302

style: format code with Black and isort

style: format code with Black and isort #1302

Workflow file for this run

---
name: CI
# Enable Buildkit and let compose use it to speed up image building
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
on:
pull_request:
branches: [ "*" ]
paths-ignore: [ "docs/**" ]
push:
branches: [ "*" ]
paths-ignore: [ "docs/**" ]
jobs:
# With no caching at all the entire ci process takes 4m 30s to complete!
pytest:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
env:
# postgres://user:password@host:port/database
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
steps:
- name: Checkout Code Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: |
requirements/base.txt
requirements/local.txt
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/local.txt
- name: Migrate Database
run: |
./manage.py makemigrations
./manage.py migrate
- name: Test with pytest and upload to coveralls
run: |
mkdir -p test-results
coverage run -m pytest
coverage lcov -o test-results/coverage.info --fail-under=90
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: test-results/coverage.info
heroku:
runs-on: ubuntu-latest
needs: pytest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout Code Repository
uses: actions/checkout@v3
- name: Deploy to Heroku
uses: AkhileshNS/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "gentle-savannah-12792"
heroku_email: ${{secrets.HEROKU_EMAIL}}