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

continuous integration #1

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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..
32 changes: 32 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
26 changes: 26 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -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