-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (76 loc) · 2.45 KB
/
python-app.yml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: tefnut testing
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
build:
name: tefnut testing
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python 3.12
uses: actions/[email protected]
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest requests-mock poetry
poetry install
- name: Create Config
run: |
cp _template.settings.toml settings.toml
- name: Test with pytest and collect coverage
run: |
poetry run pytest --cov=tefnut --cov-report=xml -W ignore::DeprecationWarning
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
ruff:
name: "Ruff"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"
- name: "Set up Python"
uses: actions/[email protected]
with:
python-version: "3.12"
- name: "Install requirements"
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
- name: "Run"
run: poetry run ruff check .
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python 3.12
uses: actions/[email protected]
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest requests-mock poetry
poetry install
- name: Create Config
run: |
cp _template.settings.toml settings.toml
- name: Test with pytest and collect coverage
run: |
poetry run pytest --cov=tefnut --cov-report=xml -W ignore::DeprecationWarning
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}