-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 43-templates-with-toc
- Loading branch information
Showing
4 changed files
with
216 additions
and
72 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,28 @@ | ||
name: Test building PyPI package | ||
on: | ||
push: | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10" ] | ||
|
||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Install pypa/build | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build | ||
- | ||
name: Build binary wheel and source tarbal | ||
run: python -m build --sdist --wheel --outdir dist/ . |
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,45 @@ | ||
name: Install from source | ||
on: | ||
push: | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10" ] | ||
|
||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Setup miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
auto-activate-base: true | ||
environment-file: conda_environment.yml | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Finish conda setup | ||
run: | | ||
conda info | ||
conda install pip | ||
python -m pip install --upgrade pip | ||
- | ||
name: Install package + remaining PyPI dependencies | ||
run: pip install . | ||
- | ||
name: Test run ScriptEngine | ||
run: | | ||
se --help | ||
se --help | grep -q "ece\.mon" |
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,70 @@ | ||
name: Package, publish to and test from PyPI | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
- | ||
name: Install pypa/build | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build | ||
- | ||
name: Build binary wheel and source tarbal | ||
run: python -m build --sdist --wheel --outdir dist/ . | ||
- | ||
name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
test-from-pypi: | ||
needs: build-n-publish | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10" ] | ||
steps: | ||
- | ||
name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Setup miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
auto-activate-base: true | ||
environment-file: conda_environment.yml | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Finish conda setup | ||
run: | | ||
conda info | ||
conda install pip | ||
python -m pip install --upgrade pip | ||
- | ||
name: Install dependencies and scriptengine-tasks-ecearth | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install scriptengine-tasks-ecearth | ||
- | ||
name: Test run ScriptEngine | ||
run: | | ||
se --help | ||
se --help | grep -q "ece\.mon" |
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 |
---|---|---|
@@ -1,80 +1,81 @@ | ||
name: PyTest | ||
on: | ||
schedule: | ||
- cron: '0 8 * * *' | ||
name: Run pytest and coverage | ||
on: | ||
push: | ||
|
||
env: | ||
TEST_DATA_REF: "https://github.com/valentinaschueller/ece-4-monitoring-test-data/archive/refs/heads/main.zip" | ||
TEST_DATA_DOWNLOAD: "test-data" | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python-version: [ '3.7', '3.8', '3.9', '3.10' ] | ||
pytest: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10" ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
|
||
- name: Setup miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
auto-activate-base: true | ||
environment-file: conda_environment.yml | ||
python-version: ${{matrix.python-version}} | ||
|
||
- name: Finish conda setup | ||
run: | | ||
conda info | ||
conda install pip | ||
python -m pip install --upgrade pip | ||
conda list | ||
- name: Install package + remaining PyPI dependencies | ||
run: pip install . | ||
|
||
- name: Download test data | ||
run: | | ||
mkdir ${TEST_DATA_DOWNLOAD}; | ||
wget -O ${TEST_DATA_DOWNLOAD}/test-data.zip ${TEST_DATA_REF}; | ||
unzip -q ${TEST_DATA_DOWNLOAD}/test-data.zip -d ${TEST_DATA_DOWNLOAD}; | ||
mv ${TEST_DATA_DOWNLOAD}/ece-4-monitoring-test-data-main/ tests/testdata; | ||
- name: Install dependencies for testing | ||
run: | | ||
python -m pip install pytest | ||
python -m pip install coverage | ||
python -m pip install coveralls | ||
python -m pip install flake8 | ||
- name: Lint with flake8 | ||
run: | | ||
# Syntax errors or undefined names | ||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics monitoring/ | ||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics helpers/ | ||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics tests/ | ||
# All other stuff | ||
flake8 --exit-zero --count --statistics --exclude=__init__.py --max-line-length=88 monitoring/ | ||
flake8 --exit-zero --count --statistics --exclude=__init__.py --max-line-length=88 helpers/ | ||
flake8 --exit-zero --count --statistics --exclude=__init__.py --max-line-length=88 tests/ | ||
- name: Run PyTest | ||
run: | | ||
coverage run -m pytest | ||
coverage lcov | ||
- name: Run Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: coverage.lcov | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Setup miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
auto-activate-base: true | ||
environment-file: conda_environment.yml | ||
python-version: ${{matrix.python-version}} | ||
- | ||
name: Finish conda setup | ||
run: | | ||
conda info | ||
conda install pip | ||
python -m pip install --upgrade pip | ||
conda list | ||
- | ||
name: Install package + remaining PyPI dependencies | ||
run: pip install . | ||
- | ||
name: Download test data | ||
run: | | ||
mkdir ${TEST_DATA_DOWNLOAD}; | ||
wget -O ${TEST_DATA_DOWNLOAD}/test-data.zip ${TEST_DATA_REF}; | ||
unzip -q ${TEST_DATA_DOWNLOAD}/test-data.zip -d ${TEST_DATA_DOWNLOAD}; | ||
mv ${TEST_DATA_DOWNLOAD}/ece-4-monitoring-test-data-main/ tests/testdata; | ||
- | ||
name: Install dependencies for testing | ||
run: | | ||
python -m pip install pytest | ||
python -m pip install coverage | ||
python -m pip install coveralls | ||
python -m pip install flake8 | ||
- | ||
name: Lint with flake8 | ||
run: | | ||
# Syntax errors or undefined names | ||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics monitoring/ | ||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics helpers/ | ||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics tests/ | ||
# All other stuff | ||
flake8 --exit-zero --count --statistics --exclude=__init__.py --max-line-length=88 monitoring/ | ||
flake8 --exit-zero --count --statistics --exclude=__init__.py --max-line-length=88 helpers/ | ||
flake8 --exit-zero --count --statistics --exclude=__init__.py --max-line-length=88 tests/ | ||
- | ||
name: Run PyTest | ||
run: | | ||
coverage run -m pytest | ||
coverage lcov | ||
- | ||
name: Run Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: coverage.lcov |