-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (63 loc) · 2.09 KB
/
drned-xmnr-unit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This workflow will install Python dependencies, run tests and lint with a multiple version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: DrNED Examiner Unit tests
on:
push:
branches:
- master
- ghworkflow
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
env:
XMNR_DIR: .
strategy:
matrix:
python-version: [ '3.10', '3.9', '3.8', '3.7', '3.6' ]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f ${XMNR_DIR}/test/unit/requirements.txt ]; then pip install -r ${XMNR_DIR}/test/unit/requirements.txt; fi
python -m pip install coverage coveralls
- name: Lint with flake8
run: |
./flake8-check.sh
- name: Type check with mypy
run: |
python -m pip install mypy
./mypy-check.sh
- name: Test with pytest
run:
PYTHONPATH=${XMNR_DIR}/python:${XMNR_DIR}/drned-skeleton:${PYTHONPATH} coverage run -m pytest -s -v ${XMNR_DIR}/test/unit
- name: Upload Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
coveralls
coveralls:
name: Indicate completion to coveralls.io
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
python -m pip install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}