From 7c766045dae0d764f544fd34bbefd0e21115e67e Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 12 Dec 2023 14:53:20 -0700 Subject: [PATCH] Add CI workflow files --- .github/workflows/format.yml | 19 ++++++++++++++++ .github/workflows/lint.yml | 21 ++++++++++++++++++ .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 .github/workflows/format.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..5d32f64 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,19 @@ +name: Format + +on: [push, pull_request] + +jobs: + + format: + + if: + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != + github.repository + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - uses: psf/black@stable + with: + args: ". --check" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a953d13 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint + +on: [push, pull_request] + +jobs: + + lint: + + if: + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != + github.repository + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + + - name: Lint + run: | + pip install flake8 + flake8 . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f00cb4f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Test + +on: [push, pull_request] + +jobs: + build-and-test: + + if: + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != + github.repository + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash -l {0} + + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.9"] + + steps: + - uses: actions/checkout@v4 + + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python-version }} + miniforge-variant: Miniforge3 + miniforge-version: latest + auto-update-conda: true + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Install package + run: | + pip install -e . + + - name: Test + run: | + pytest -vvv