-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (64 loc) · 2.62 KB
/
code-quality.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
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
name: Code-quality
on:
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
push:
branches:
- main
paths-ignore:
- .gitignore
- .github/**
- .pre-commit-config.yaml
- README.md
- docs
- pdm.lock
jobs:
code-quality:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, the same as actions/setup-python
architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python
version: 2.8.0 # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub
prerelease: false # Allow prerelease versions of PDM to be installed
enable-pep582: false # Enable PEP 582 package loading globally
allow-python-prereleases: false # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fallback to 3.12-dev
update-python: true # Update the environment with the requested python version
cache: true
cache-dependency-path: "**/pdm.lock"
- name: Install dependencies
run: pdm install
- name: Run flake8
run: pdm run flake8
- name: Run Pyupgrade
run: pdm run pyupgrade
- name: Run Refurb
run: pdm run refurb
- name: Run black
run: pdm run black
- name: Run isort
run: pdm run isort
- name: Run Pydocstyle
run: pdm run pydocstyle
- name: Run Mypy
run: pdm run mypy
- name: Run Pytest
run: pdm run pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}