Skip to content

Commit

Permalink
Merge branch 'master' into 43-templates-with-toc
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinaschueller committed Jul 1, 2022
2 parents 627f94f + e007c9b commit e1866f7
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 72 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-package.yml
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/ .
45 changes: 45 additions & 0 deletions .github/workflows/install-from-source.yml
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"
70 changes: 70 additions & 0 deletions .github/workflows/publish-to-pypi.yml
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"
145 changes: 73 additions & 72 deletions .github/workflows/pytest.yml
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

0 comments on commit e1866f7

Please sign in to comment.