github actions: mamba fixes #73
Workflow file for this run
This file contains hidden or 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
| name: conda build | |
| on: [ push ] | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: micromamba-shell {0} | |
| services: | |
| postgres: | |
| image: postgis/postgis:16-3.4 | |
| env: | |
| POSTGRES_PASSWORD: Password12! | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| cache-environment: true | |
| init-shell: bash | |
| generate-run-shell: true | |
| post-cleanup: 'all' | |
| - name: Install ESA SNAP | |
| run: | | |
| wget -nv https://download.esa.int/step/snap/12.0/installers/esa-snap_all_linux-12.0.0.sh | |
| bash esa-snap_all_linux-12.0.0.sh -q -dir $GITHUB_ACTION_PATH/esa-snap | |
| - name: Set paths and variables | |
| run: | | |
| echo "$CONDA/bin" >> $GITHUB_PATH | |
| echo "$GITHUB_ACTION_PATH/esa-snap/bin" >> $GITHUB_PATH | |
| echo "PROJ_DATA=$CONDA/share/proj" >> $GITHUB_ENV | |
| - name: Install python packages | |
| run: | | |
| micromamba install -y python=3.10 flake8 -n ps_test | |
| micromamba env update --file environment-dev.yml -n ps_test | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Install pyroSAR | |
| run: | | |
| pip install . | |
| - name: Test with pytest | |
| run: | | |
| coverage run --data-file="${GITHUB_WORKSPACE}/.coverage" -m pytest | |
| env: | |
| PGUSER: postgres | |
| PGPASSWORD: Password12! | |
| - name: Show coverage file location (optional) | |
| run: ls -lha "${GITHUB_WORKSPACE}" | |
| - name: Publish to coveralls.io | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ github.token }} | |
| build-windows: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: cmd /C CALL {0} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| cache-environment: true | |
| init-shell: cmd.exe | |
| post-cleanup: 'all' | |
| - uses: nyurik/action-setup-postgis@v2 | |
| with: | |
| cached-dir: C:\downloads | |
| - name: Install ESA SNAP | |
| run: | | |
| curl -O https://download.esa.int/step/snap/12.0/installers/esa-snap_all_windows-12.0.0.exe | |
| start /wait esa-snap_all_windows-12.0.0.exe -q -dir C:\esa-snap | |
| - name: Set paths and variables | |
| run: | | |
| echo %CONDA%\Scripts>> %GITHUB_PATH% | |
| echo C:\esa-snap\bin>> %GITHUB_PATH% | |
| echo PROJ_DATA=%CONDA%\share\proj>> %GITHUB_ENV% | |
| - name: Install python packages | |
| run: | | |
| mamba env update --file environment-dev.yml -n base | |
| - name: Install pyroSAR | |
| run: | | |
| pip install . | |
| - name: Test with pytest | |
| run: | | |
| pytest | |
| env: | |
| PGUSER: postgres | |
| PGPASSWORD: postgres |