This repository was archived by the owner on Sep 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (54 loc) · 1.41 KB
/
lint_and_test.yml
File metadata and controls
55 lines (54 loc) · 1.41 KB
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
name: Push and PR workflow
on:
push:
pull_request:
env:
repository: https://github.com/powerapi-ng/virtualwatts-formula
jobs:
lint_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
services:
mongo:
image: mongo:latest
ports:
- 27017:27017
steps:
- name: Install tools
run: |
sudo apt update
sudo apt install -y libvirt-dev procps
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python3 -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install flake8 pylint
pip install .
- name: Test with pytest
run: |
. venv/bin/activate
python setup.py pytest
- name: Lint with flake8
run: |
. venv/bin/activate
flake8 virtualwatts
- name: Lint with pylint
run: |
. venv/bin/activate
pylint virtualwatts