-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 1.03 KB
/
lint-sca.yaml
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
name: "Lint and static code analysis"
on:
push:
pull_request:
branches:
- main
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: '3.8'
architecture: 'x64'
- name: Install poetry
run: pip install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: poetry-cache
with:
path: |
~/.cache/pypoetry
.venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: poetry install
if: steps.poetry-cache.outputs.cache-hit != 'true'
- name: Lint code style
run: poetry run python -m black --check --diff .
- name: Static code analysis
run: poetry run python -m pyright
- name: Run tests
run: poetry run python -m pytest --cov="xkcd_cli/"