Skip to content

Commit

Permalink
Switch actions over to pre-commit (#73)
Browse files Browse the repository at this point in the history
* Switch actions over to pre-commit

* Static check newline fix

* Fix README newline
  • Loading branch information
AetherUnbound authored Sep 10, 2021
1 parent 6aad01e commit f01d9b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 33 deletions.
36 changes: 5 additions & 31 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: pull_request

jobs:

format:
static-checks:
runs-on: ubuntu-latest

steps:
Expand All @@ -13,40 +13,14 @@ jobs:
with:
python-version: 3.8
- name: Install Dependencies
run: pip install black
- name: Check formatting with black
run: black --check .

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Dependencies
run: pip install flake8
- name: Lint with flake8
run: flake8 .

types:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Dependencies
run: pip install mypy types-ujson
- name: Check typing with mypy
run: mypy .
run: pip install pre-commit
- name: Run static checks
run: pre-commit run --all-files

test:
runs-on: ubuntu-latest
# Tests are expensive to run, don't run them unless the other checks pass
needs: [format, lint, types]
needs: [static-checks]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To deploy, copy `.env.example` to `.env` and populate with the appropriate value

## Setup

We use `just` as our command runner for this repo.
We use `just` as our command runner for this repo.
The same `just` commands described below can be used to deploy production.
The `docker-compose-prod.yml` file defines the minimum services for running in production.
In order to use this file, set the `IS_PROD` environment variable to `true`.
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ register:

# Static checks
static:
pre-commit run --all-files
pre-commit run --all-files

0 comments on commit f01d9b1

Please sign in to comment.