diff --git a/.github/workflows/build-gcpy-environment.yml b/.github/workflows/build-gcpy-environment.yml new file mode 100644 index 00000000..33bd0063 --- /dev/null +++ b/.github/workflows/build-gcpy-environment.yml @@ -0,0 +1,34 @@ +--- +# +# GitHub action to build the GCPy environment with micromamba +# See: https://github.com/marketplace/actions/setup-micromamba +# +name: build-gcpy-environment + +on: + push: + branches: [ "main", "dev" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main", "dev" ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9"] + steps: + - uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: 'latest' + environment-file: docs/source/environment.yml + init-shell: bash + cache-environment: true + post-cleanup: 'all' + - name: Import gcpy in micromamba environment (bash) + run: python -c "import numpy" + shell: bash -el {0} + - name: Run custom command in micromamba environment + run: python -m gcpy.examples.plotting.create_test_plot + shell: micromamba-shell {0} diff --git a/CHANGELOG.md b/CHANGELOG.md index 86335626..7c68b041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - TBD ### Added - Example script `create_test_plot.py`, which can be used to check that GCPy has been installed properly - +- GitHub action `build-gcpy-environment` which tests installation of the mamba environment specified in in `docs/source/environment.yml` ## [1.4.1] - 2023-12-08 ### Fixed