diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..9eece9e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +**Summary**: + +**Related issue**: + +**Suggested reviewer(s)**: + +**Reviewer checklist**: + +* [ ] The headers of all files contain a reference to the repository license +* [ ] 100% test coverage of new code - meaning: + * [ ] The overall test coverage increased or remained the same as before + * [ ] Every function is accompanied with a test suite + * [ ] Tests are both positive (testing that the function work as intended with valid data) and negative (testing that the function behaves as expected with invalid data, e.g., that correct exceptions are thrown) + * [ ] Functions with optional arguments have separate tests for all options +* [ ] Examples are supported by doctests +* [ ] All tests are passing +* [ ] All names (e.g., files, classes, functions, variables) are explicit +* [ ] Documentation (as docstrings) is complete and understandable + +The checklist is based on the S-ENDA conventions and definition of done (see [General Conventions](https://s-enda-documentation.readthedocs.io/en/latest/general_conventions.html)). The above points are not necessarily relevant to all contributions. In that case, be pragmatic.. diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..e6cf67f --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,32 @@ +name: pytest + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + pyTestCov: + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + runs-on: ubuntu-latest + steps: + - name: Python Setup + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Checkout Source + uses: actions/checkout@v2 + - name: Install Dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install pytest-timeout + pip install pytest-cov + - name: Run Tests + run: python -m pytest -v --cov=sarwind --timeout=60 + - name: Upload to Codecov + uses: codecov/codecov-action@v1 diff --git a/.github/workflows/syntax.yml b/.github/workflows/syntax.yml new file mode 100644 index 0000000..75f4376 --- /dev/null +++ b/.github/workflows/syntax.yml @@ -0,0 +1,25 @@ +name: flake8 + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + checkSyntax: + runs-on: ubuntu-latest + steps: + - name: Python Setup + uses: actions/setup-python@v1 + with: + python-version: 3.9 + architecture: x64 + - name: Checkout Source + uses: actions/checkout@v2 + - name: Install flake8 + run: pip install flake8 + - name: Syntax Error Check + run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude external + - name: Code Style Check + run: flake8 . --count --max-line-length=99 --ignore E221,E226,E228,E241 --show-source --statistics --exclude external diff --git a/README.md b/README.md index 8468754..332b653 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![flake8](https://github.com/metno/met-sar-vind/actions/workflows/syntax.yml/badge.svg?branch=main)](https://github.com/metno/met-sar-vind/actions/workflows/syntax.yml) +[![pytest](https://github.com/metno/met-sar-vind/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/metno/met-sar-vind/actions/workflows/pytest.yml) +[![codecov](https://codecov.io/gh/metno/met-sar-vind/branch/main/graph/badge.svg?token=xSG9Sg0jQ0)](https://codecov.io/gh/metno/met-sar-vind) + # met-sar-vind System for SAR wind processing. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..7d57c63 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,26 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + + status: + project: + default: + threshold: 1% + patch: + default: + threshold: 1% + changes: no + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: false