Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reviewed github actions #90

Merged
merged 102 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
c3135ca
disable conda progress bar in CI
oarcher May 7, 2022
a3f688c
generic CI
oarcher May 7, 2022
d2c96a0
fixed os generic CI
oarcher May 7, 2022
65f891c
CI build-matrix
oarcher May 7, 2022
a95a50a
CI build-matrix addon
oarcher May 7, 2022
28be7be
CI build-matrix addon fix
oarcher May 7, 2022
7c9941a
CI build-matrix addon fix
oarcher May 7, 2022
da74ade
CI build-matrix addon fix
oarcher May 7, 2022
1d5defc
CI build-matrix addon fix
oarcher May 7, 2022
d0fba84
CI build-matrix addon fix
oarcher May 7, 2022
54ed71a
CI build-matrix addon fix
oarcher May 7, 2022
b1a24f5
CI build-matrix addon fix
oarcher May 7, 2022
397a655
CI build-matrix addon fix
oarcher May 7, 2022
5f05891
CI build-matrix addon fix
oarcher May 7, 2022
5ea4a7e
CI build-matrix addon fix
oarcher May 7, 2022
9feb23d
CI build-matrix addon fix
oarcher May 7, 2022
e881254
CI build-matrix addon fix
oarcher May 7, 2022
e461199
CI build-matrix addon fix
oarcher May 7, 2022
690f415
CI build-matrix addon fix
oarcher May 7, 2022
92b56d1
CI build-matrix addon fix
oarcher May 7, 2022
8512837
CI build-matrix addon fix
oarcher May 7, 2022
d55f91c
CI build-matrix addon fix
oarcher May 7, 2022
d528bc4
CI build-matrix addon fix
oarcher May 7, 2022
3643541
CI build-matrix addon fix
oarcher May 8, 2022
cc7fc21
CI build-matrix addon fix
oarcher May 8, 2022
0c22b77
CI build-matrix addon fix
oarcher May 8, 2022
f2fd4b1
CI dynamic actions
oarcher May 8, 2022
23336d5
CI dynamic actions
oarcher May 8, 2022
4e7dcfd
CI dynamic actions
oarcher May 8, 2022
e790ae5
CI dynamic actions
oarcher May 8, 2022
ff89510
CI dynamic actions
oarcher May 8, 2022
3e369ca
CI dynamic actions
oarcher May 8, 2022
e65f711
slit requirements
oarcher May 8, 2022
70f2880
install pytest and dill
oarcher May 8, 2022
41200e0
install pytest and dill
oarcher May 8, 2022
8ed4541
add requests to setup.py
oarcher May 8, 2022
33d3380
force doc if push
oarcher May 8, 2022
d0b142d
echo dynamic
oarcher May 8, 2022
65a8a4c
quote
oarcher May 8, 2022
b7542d2
quote
oarcher May 8, 2022
94ddb79
quote
oarcher May 8, 2022
7aa6362
quote
oarcher May 8, 2022
dbceae5
quote
oarcher May 8, 2022
86ebdf3
quote
oarcher May 8, 2022
dca6907
quote
oarcher May 8, 2022
813aa56
quote
oarcher May 8, 2022
d3ba2b2
quote
oarcher May 8, 2022
21586a0
quote
oarcher May 8, 2022
0638ab5
quote
oarcher May 8, 2022
6784bc2
quote
oarcher May 8, 2022
8006b52
quote
oarcher May 8, 2022
ffff1fd
add datashader
oarcher May 8, 2022
b4f6b1d
add datashader
oarcher May 8, 2022
faebc23
composite
oarcher May 8, 2022
26d66cc
composite
oarcher May 8, 2022
a8a3206
composite
oarcher May 8, 2022
4696b8b
composite
oarcher May 8, 2022
ccdaa52
composite
oarcher May 8, 2022
d81ed48
composite test
oarcher May 8, 2022
5815ee1
fix schedule
oarcher May 8, 2022
098d2e9
add pandoc
oarcher May 8, 2022
5cb4253
modified schedule
oarcher May 8, 2022
78f3325
add pytest
oarcher May 8, 2022
32ae8b2
add python endoflife
oarcher May 8, 2022
c4c1560
install conda packages from scratch (no xsar conda dep)
oarcher May 8, 2022
4556a9d
add environment.yml
oarcher May 8, 2022
c2cdb1e
disable conda auto-activate
oarcher May 8, 2022
2ba05b2
use condarc, build from conda-incubator
oarcher May 8, 2022
be11747
update minimal install
oarcher May 8, 2022
5fa5745
nested doc filter
oarcher May 8, 2022
2034992
typo
oarcher May 8, 2022
0bc28b5
check doc
oarcher May 8, 2022
39b7cf6
check docs
oarcher May 8, 2022
9d9aff1
check docs
oarcher May 8, 2022
4d23bb6
about to remove composite
oarcher May 8, 2022
ac1f156
reduced conda deps
oarcher May 8, 2022
78e5495
conda cache (using mamba)
oarcher May 8, 2022
24ee6dc
check cache
oarcher May 8, 2022
7db2bb2
check cache
oarcher May 8, 2022
9b56428
check cache hit
oarcher May 8, 2022
f678685
check cache hit
oarcher May 8, 2022
02577a1
use ~/conda_pkgs_dir
oarcher May 8, 2022
e4b650a
check cache ~/conda_pkgs_dir
oarcher May 8, 2022
12facd5
check cache ~/conda_pkgs_dir
oarcher May 8, 2022
45fb4b4
try to use CONDA_PREFIX
oarcher May 8, 2022
a2dac1a
try to use CONDA_PREFIX
oarcher May 8, 2022
5bf00a5
try to use CONDA_PREFIX
oarcher May 8, 2022
0cb3ba1
check CONDA_PREFIX cache hit
oarcher May 8, 2022
51dc96c
removed pkg_dirs, force rebuild
oarcher May 8, 2022
a446795
removed pkg_dirs, force rebuild
oarcher May 8, 2022
4ddc6dc
added python version
oarcher May 8, 2022
394187b
added python version
oarcher May 8, 2022
e17ac64
added python version
oarcher May 8, 2022
8ca52dc
added python version
oarcher May 8, 2022
d7466d6
added python version
oarcher May 8, 2022
0a46edb
pin python from matrix.python-version
oarcher May 8, 2022
aaa7140
pin python from matrix.python-version
oarcher May 8, 2022
ad65a61
pin python from matrix.python-version
oarcher May 8, 2022
123946c
pin python from matrix.python-version
oarcher May 8, 2022
41209c7
schedule
oarcher May 8, 2022
849006b
full matrix on pull_request_review
oarcher May 8, 2022
3498e82
remove python 3.7 support ( incompatible with rioxarray >=0.10)
oarcher May 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/actions/dynamic_matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import sys
import urllib.request
import json
import datetime
# minimal python script that returns a strategy matrix, for given github.event_name


with urllib.request.urlopen('https://endoflife.date/api/python.json') as f:
python_versions = json.loads(f.read().decode('utf-8'))

now = datetime.datetime.now().strftime('%Y-%m-%d')
python_supported_versions = [ v['cycle'] for v in python_versions if v['eol'] > now and v['cycle'] != '3.7' ]

python_default_version = python_supported_versions[1]

matrix = {
'default': {
'os': ['ubuntu-latest'],
'python_version': [python_default_version],
},
'pull_request': {
'os': ['ubuntu-latest'],
'python_version': [python_default_version],
},
'schedule': {
'os': ['ubuntu-latest', 'macos-latest', 'windows-latest'],
'python_version': python_supported_versions,
},
'release': {
'os': ['ubuntu-latest', 'macos-latest', 'windows-latest'],
'python_version': python_supported_versions,
},
'pull_request_review': {
'os': ['ubuntu-latest', 'macos-latest', 'windows-latest'],
'python_version': python_supported_versions,
}
}

if __name__ == "__main__":
try:
event = sys.argv[1]
except IndexError:
event = 'default'
if event not in matrix:
event = 'default'

print('::set-output name=os_matrix::%s' % str(matrix[event]['os']))
print('::set-output name=python_version_matrix::%s' % str(matrix[event]['python_version']))
48 changes: 0 additions & 48 deletions .github/workflows/generate-doc.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/install-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Install test

on:
push:
branches:
- develop
pull_request:
branches:
- develop
schedule:
- cron: '25 16 * * 0'
release:
types:
- published
pull_request_review:
types:
- submitted

env:
CACHE_NUMBER: 0 # increase to reset cache manually

jobs:
dynamic-matrix:
# from https://michaelheap.com/dynamic-matrix-generation-github-actions/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: get-matrix
run: |
echo "get matrix for event ${{ github.event_name }}"
echo "::echo::on"
python .github/actions/dynamic_matrix.py ${{ github.event_name }}
outputs:
os_matrix: ${{ steps.get-matrix.outputs.os_matrix }}
python_version_matrix: ${{ steps.get-matrix.outputs.python_version_matrix }}

build:
needs: dynamic-matrix
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.dynamic-matrix.outputs.os_matrix) }}
python-version: ${{ fromJson(needs.dynamic-matrix.outputs.python_version_matrix) }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
name: python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

# cache conda from https://dev.to/epassaro/caching-anaconda-environments-in-github-actions-5hde
# and https://github.com/conda-incubator/setup-miniconda#caching
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: xsar
python-version: ${{ matrix.python-version }}
condarc-file: condarc.yml
use-mamba: true
use-only-tar-bz2: true

- name: Set cache date
run: |
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV

- uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: conda-cache-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache

- name: Cache found
run: echo Cache found
if: steps.cache.outputs.cache-hit == 'true'

# update conda. Cache will be used if available
# we remove python from environment.yml, because we want the version from matrix.python-version
- name: update conda
run: |
cat environment.yml | egrep -vw 'python' > ~/environment-nopython.yml
mamba env update -n xsar -f ~/environment-nopython.yml

- name: List Packages
run: |
python -V
conda info
conda list

- name: Minimal install
run: pip install -e .

- name: Minimal pytest
run: |
pip install pytest dill
pytest

# check if docs has changed
- uses: dorny/paths-filter@v2
id: changes
if: github.event_name != 'schedule'
with:
filters: |
docs:
- 'docs/**'
# run only if some file in 'doc' folder was changed
- name: Complete notebook install
if: github.event_name == 'schedule' || steps.changes.outputs.docs == 'true'
run: pip install -r requirements.txt

- name: Documetation test
if: github.event_name == 'schedule' || steps.changes.outputs.docs == 'true'
run: |
cd docs
make html



48 changes: 0 additions & 48 deletions .github/workflows/mac-os-install-test.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/ubuntu-install-test.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/windows-install-test.yml

This file was deleted.

4 changes: 4 additions & 0 deletions condarc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
always_yes: true
quiet: true


1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
pip install -r ../requirements_doc.txt
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/scripts/conda_install_minimal
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conda install -c conda-forge xsar 'rioxarray>=0.10' 'python<3.10'
conda install -c conda-forge xsar
2 changes: 1 addition & 1 deletion docs/scripts/conda_install_recommended
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conda install -c conda-forge xsar 'rioxarray>=0.10' jupyterlab geoviews cartopy_offlinedata holoviews datashader 'shapely<1.8.0' nbsphinx pandoc jq docutils pip git lxml 'python<3.10'
conda install -c conda-forge xsar 'rioxarray>=0.10' jupyterlab geoviews cartopy_offlinedata holoviews datashader 'shapely<1.8.0' pandoc jq docutils pip git lxml python
Loading