From d10edf74f0692f3d4605456244dc71034c3579fe Mon Sep 17 00:00:00 2001 From: Crossedfall Date: Mon, 16 Oct 2023 20:34:51 -0500 Subject: [PATCH] Adds a linting CI --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a0ebd8f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI +on: + workflow_dispatch: + pull_request: + branches: + - master + push: + +jobs: + run_lints: + name: Run linters + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Python setup + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install poetry + run: | + python -m pip install -U poetry + - id: cache-poetry + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry/virtualenvs + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + if: steps.cache-poetry.outputs.cache-hit != 'true' + run: | + poetry install + - uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-pre_commit-${{ hashFiles('.pre-commit-config.yaml') }} + - name: Pre-commit linters + run: | + poetry run pre-commit run --show-diff-on-failure --color=always --all-files