Skip to content

Commit 5cbe640

Browse files
committed
added linting and unit testing workflow
1 parent 4440f31 commit 5cbe640

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python Test and Lint
5+
6+
on: [push]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.8", "3.9", "3.10"]
16+
17+
steps:
18+
- name: Checkout
19+
- uses: actions/checkout@v3
20+
- name: Switch to Current Branch
21+
run: git checkout ${{ env.BRANCH }}
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install Dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python3.8 -m venv venv_test
30+
source venv_test/bin/activate
31+
python -m pip install pylint pytest
32+
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
33+
- name: Analysing the code with pylint
34+
run: |
35+
pylint $(git ls-files '*.py')
36+
- name: Test with pytest
37+
run: |
38+
pytest

0 commit comments

Comments
 (0)