From 825fcfda6560e238b5c4a6699006f4806e66b213 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 18 Jul 2024 18:47:19 -0600 Subject: [PATCH] Add continuous integration workflow which runs mypy --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++++++++++++++++++++ environment.yml | 3 ++ 2 files changed, 62 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..f7c9e69 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: Continuous Integration + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + # Many color libraries just need this to be set to any value, but at least + # one distinguishes color depth, where "3" -> "256-bit color". + FORCE_COLOR: 3 + + +jobs: + checks: + name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + python-version: ["3.8"] + runs-on: + - ubuntu-latest + - macos-latest + # - windows-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: '1.5.6-0' # any version from https://github.com/mamba-org/micromamba-releases + environment-file: environment.yml + init-shell: >- + bash + powershell + cache-environment: true + post-cleanup: 'all' + + - name: Type-check package + run: mypy + + # - name: Test package + # run: >- + # python -m pytest -ra --cov --cov-report=xml --cov-report=term + # --durations=20 + + # - name: Upload coverage report + # uses: codecov/codecov-action@v4.5.0 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} diff --git a/environment.yml b/environment.yml index 0ae58b0..5bbd294 100644 --- a/environment.yml +++ b/environment.yml @@ -14,3 +14,6 @@ dependencies: # Development dependencies - matplotlib-base - pre-commit + + - mypy + - types-pillow ~=9.2