-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (62 loc) · 1.97 KB
/
tests.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Test
on:
push:
branches-ignore:
- main
permissions: read-all
jobs:
test:
strategy:
fail-fast: false
matrix:
python_version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- name: Update python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Install Poetry
run: curl -sSL curl -sSL https://install.python-poetry.org | python3 -
- name: Set env
run: echo "PATH=${PATH}:$HOME/.poetry/bin" >> $GITHUB_ENV
- name: Checkout branch
uses: actions/checkout@v4
- name: Install packages via Poetry
run: poetry install
- name: Run tests with coverage
run: poetry run coverage run --branch --module pytest
- name: Check type annotations
run: poetry run mypy
- name: Check code style
run: poetry run pylint msps
sonarcloud:
runs-on: ubuntu-latest
steps:
- name: Update python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: x64
- name: Install Poetry
run: curl -sSL curl -sSL https://install.python-poetry.org | python3 -
- name: Set env
run: echo "export PATH=${PATH}:$HOME/.poetry/bin" >> $GITHUB_ENV
- name: Checkout branch
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Install packages via Poetry
run: poetry install
- uses: actions/checkout@v4
- name: Run tox
run: poetry run tox -e py
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v3.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
JAVA_HOME: /opt/java/openjdk
SONAR_SCANNER_HOME: /opt/sonar-scanner