Skip to content

Commit

Permalink
remove all but essential changes from pre-commit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TimidRobot committed Nov 8, 2021
1 parent a10e2cc commit 4dfc9bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc gettext pandoc
sudo apt-get install -y pandoc
# https://github.com/actions/checkout
- name: Checkout cc-licenses
Expand All @@ -61,30 +61,31 @@ jobs:
python-version: "3.7"

- name: Install pipenv
# Use pipenv 2021.5.29 to circumvent errors:
# Use pipenv 2021.5.29 to circumvent errors with 2021.11.5.post0 on
# Ubuntu 20.04
# https://github.com/pypa/pipenv/issues/4833
run: |
python -m pip install --no-cache-dir --upgrade pip
python -m pip install --no-cache-dir pipenv==2021.5.29
python -m pip install --upgrade pip
python -m pip install pipenv==2021.5.29
- name: Install Python dependencies
run: |
pipenv sync --dev --system
pipenv sync --dev
- name: Update Django database schema
env:
DATA_REPOSITORY_DIR: cc-licenses-data
run: |
./manage.py migrate
pipenv run ./manage.py migrate
- name: Start Django development web server
env:
DATA_REPOSITORY_DIR: cc-licenses-data

run: |
./manage.py runserver &>/dev/null &
pipenv run ./manage.py runserver &>/dev/null &
# https://github.com/pre-commit/action
- uses: pre-commit/[email protected].3
- uses: pre-commit/[email protected].0
env:
DATA_REPOSITORY_DIR: cc-licenses-data
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,41 @@ repos:
hooks:
- id: black
name: "Black"
entry: black --check
entry: pipenv run black --check
language: system
types: ["file", "python", "text"]

- id: flake8
name: "Flake8"
entry: flake8
entry: pipenv run flake8
language: system
types: ["file", "python", "text"]

- id: isort
name: "isort"
entry: isort --check --filter-files
entry: pipenv run isort --check --filter-files
language: system
types: ["file", "python", "text"]

- id: missing-migrations
name: 'Missing migrations'
entry: ./manage.py makemigrations --check
entry: pipenv run ./manage.py makemigrations --check
language: system
types: ["file", "python", "text"]
pass_filenames: false

# This test fails if web server is not running
- id: coverage-test
name: 'Run Django tests'
entry: coverage run manage.py test --noinput --keepdb
entry: pipenv run coverage run manage.py test --noinput --keepdb
language: system
types: ["file", "python", "text"]
pass_filenames: false
require_serial: true

- id: coverage-report
name: 'Confirm test coverage'
entry: coverage report
entry: pipenv run coverage report
language: system
types: ["file", "python", "text"]
pass_filenames: false
Expand Down

0 comments on commit 4dfc9bb

Please sign in to comment.