-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continuous integration workflow with GitHub's 'actions' (#51)
* Continuous integration workflow with GitHub's 'actions' * Download and cache OceansDB data OceansDB is used for topography and climatology checks. These can be relatively large files. Use a cache to run tests. * Running pytest * fix: _curvature_numpy() is now curvature()
- Loading branch information
Showing
2 changed files
with
84 additions
and
1 deletion.
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,83 @@ | ||
name: CoTeDe | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
pip install -e . | ||
- name: Cache ETOPO | ||
id: cache-etopo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.config/oceansdb/etopo5.nc | ||
key: ${{ runner.os }}-ETOPO | ||
|
||
- name: Download ETOPO database | ||
if: steps.cache-etopo.outputs.cache-hit != 'true' | ||
run: python -c "import oceansdb; oceansdb.ETOPO()['topography']" | ||
|
||
- name: Cache WOA | ||
id: cache-woa | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.config/oceansdb/woa18_decav_t13_5d.nc | ||
~/.config/oceansdb/woa18_decav_t14_5d.nc | ||
~/.config/oceansdb/woa18_decav_t15_5d.nc | ||
~/.config/oceansdb/woa18_decav_t16_5d.nc | ||
~/.config/oceansdb/woa18_decav_s13_5d.nc | ||
~/.config/oceansdb/woa18_decav_s14_5d.nc | ||
~/.config/oceansdb/woa18_decav_s15_5d.nc | ||
~/.config/oceansdb/woa18_decav_s16_5d.nc | ||
key: ${{ runner.os }}-WOA | ||
|
||
- name: Download WOA database | ||
if: steps.cache-woa.outputs.cache-hit != 'true' | ||
run: | | ||
python -c "import oceansdb; oceansdb.WOA()['sea_water_temperature']" | ||
python -c "import oceansdb; oceansdb.WOA()['sea_water_salinity']" | ||
- name: Cache CARS | ||
id: cache-cars | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.config/oceansdb/temperature_cars2009a.nc | ||
~/.config/oceansdb/salinity_cars2009a.nc | ||
key: ${{ runner.os }}-CARS | ||
|
||
- name: Download CARS database | ||
if: steps.cache-cars.outputs.cache-hit != 'true' | ||
run: | | ||
python -c "import oceansdb; oceansdb.CARS()['sea_water_temperature']" | ||
python -c "import oceansdb; oceansdb.CARS()['sea_water_salinity']" | ||
- name: Test with pytest | ||
run: | | ||
pytest tests |
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