Skip to content

Commit

Permalink
[cicd] build and tests on multiple OS
Browse files Browse the repository at this point in the history
  • Loading branch information
johntruckenbrodt authored Apr 12, 2024
1 parent 6baba83 commit 712d71c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,37 @@ name: conda build
on: [ push ]

jobs:
build-linux:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
- name: Set paths and variables windows
if: startsWith(matrix.os, 'windows')
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
echo "$env:CONDA\condabin" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "$env:CONDA\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "$env:CONDA\Library\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "PROJ_DATA=$env:CONDA\Library\share\proj" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Set paths and variables
if: ${{ ! startsWith(matrix.os, 'windows') }}
run: |
echo "$CONDA/bin" >> $GITHUB_PATH
echo "PROJ_DATA=$CONDA/share/proj" >> $GITHUB_ENV
- name: Install dependencies
run: |
conda env update --file environment.yml --name base
echo "PROJ_DATA=$CONDA/share/proj" >> $GITHUB_ENV
- name: Lint with flake8
if: startsWith(matrix.os, 'ubuntu')
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Detailed instructions can be found in the documentation [here][14].
A jupyter notebook and test data are available [here][11].

[1]: https://github.com/johntruckenbrodt/spatialist/actions/workflows/python-package-conda.yml/badge.svg
[2]: https://www.travis-ci.com/johntruckenbrodt/spatialist
[2]: https://github.com/johntruckenbrodt/spatialist/actions/workflows/python-package-conda.yml
[5]: https://coveralls.io/repos/github/johntruckenbrodt/spatialist/badge.svg?branch=master
[6]: https://coveralls.io/github/johntruckenbrodt/spatialist?branch=master
[7]: https://readthedocs.org/projects/spatialist/badge/?version=latest
Expand Down

0 comments on commit 712d71c

Please sign in to comment.