-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #307 from johntruckenbrodt/github_actions_tests
add conda build and test to GitHub actions
- Loading branch information
Showing
3 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: conda build | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
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: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
python-version: '3.10' | ||
- name: install ESA SNAP | ||
run: | | ||
wget -nv https://download.esa.int/step/snap/10_0/installers/esa-snap_sentinel_linux-10.0.0.sh | ||
bash esa-snap_sentinel_linux-10.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 dependencies | ||
run: | | ||
: # https://github.com/conda/conda/issues/13560#issuecomment-1992720842 | ||
conda install -y python=3.10 | ||
conda env update --file environment.yml --name base | ||
- name: Lint with flake8 | ||
run: | | ||
conda install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Install package | ||
run: | | ||
pip install . | ||
- name: Test with pytest | ||
run: | | ||
conda install pytest coverage | ||
coverage run -m pytest | ||
env: | ||
PGUSER: postgres | ||
PGPASSWORD: Password12! | ||
- name: Publish to coveralls.io | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ github.token }} |
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 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