Fix pip install and add new tests #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow checks that pip installation works to import the package (tests are in python-tests.yml) | |
name: pip-install | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
name: ${{ matrix.os }}, python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11"] | |
# Run all shells using bash (including Windows) | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
# We initiate the environment empty, and check if a key for this environment doesn't already exist in the cache | |
- name: Initiate empty environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
auto-update-conda: true | |
use-mamba: true | |
channel-priority: strict | |
activate-environment: xdem-dev | |
python-version: | |
- name: Get month for resetting cache | |
id: get-date | |
run: echo "cache_date=$(/bin/date -u '+%Y%m')" >> $GITHUB_ENV | |
shell: bash | |
- name: Install project | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pip install -e . | |
# This steps allows us to check the "import xdem" with the base environment provided to users, before adding | |
# development-specific dependencies by differencing the env and dev-env yml files | |
- name: Check import works with base environment | |
run: | | |
# We unset the PROJ_DATA environment variable to make PROJ work on Windows | |
unset PROJ_DATA | |
python -c "import xdem" | |