From f01d9b139413b482174323fa63ef7516b36727c0 Mon Sep 17 00:00:00 2001 From: Madison Swain-Bowden Date: Fri, 10 Sep 2021 14:57:29 -0700 Subject: [PATCH] Switch actions over to pre-commit (#73) * Switch actions over to pre-commit * Static check newline fix * Fix README newline --- .github/workflows/pull-request.yml | 36 +++++------------------------- README.md | 2 +- justfile | 2 +- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2336786..faccadf 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,7 +4,7 @@ on: pull_request jobs: - format: + static-checks: runs-on: ubuntu-latest steps: @@ -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 diff --git a/README.md b/README.md index 813d806..f2834b4 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/justfile b/justfile index 9dbe7fa..482ac0f 100644 --- a/justfile +++ b/justfile @@ -26,4 +26,4 @@ register: # Static checks static: - pre-commit run --all-files \ No newline at end of file + pre-commit run --all-files