Skip to content

Commit f39fc4d

Browse files
committed
Introduce Lint and Test GH actions
1 parent a10b692 commit f39fc4d

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
7+
name: Lint
8+
jobs:
9+
chore:
10+
name: Lint and check format
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: "3.x"
19+
20+
- name: Setup virtualenv
21+
run: |
22+
pip install -U pip
23+
python3 -m venv .venv
24+
25+
- name: Print environment
26+
run: |
27+
source .venv/bin/activate
28+
python --version
29+
pip --version
30+
31+
- name: Install all dependencies
32+
run: |
33+
source .venv/bin/activate
34+
pip install -r requirements.txt
35+
pip install -r requirements_dev.txt
36+
pip install pre-commit
37+
38+
- name: Lint
39+
run: |
40+
source .venv/bin/activate
41+
pre-commit run --all-files --show-diff-on-failure

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
7+
name: Test
8+
jobs:
9+
chore:
10+
name: Run unit tests
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: "3.x"
19+
20+
- name: Setup virtualenv
21+
run: |
22+
pip install -U pip
23+
python3 -m venv .venv
24+
25+
- name: Print environment
26+
run: |
27+
source .venv/bin/activate
28+
python --version
29+
pip --version
30+
31+
- name: Install all dependencies
32+
run: |
33+
source .venv/bin/activate
34+
pip install -r requirements.txt
35+
pip install -r requirements_dev.txt
36+
37+
- name: Test
38+
run: |
39+
source .venv/bin/activate
40+
py.test

0 commit comments

Comments
 (0)