Skip to content

Develop #455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/python-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Python CI Coverage

on:
push:
branches: [ "main", "develop", "feature/*" ]
pull_request:
branches: [ "main" ]

env:
LOG_LEVEL: INFO

jobs:

build:
name: "Run CI"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python: ['3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Setup Python
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python }}

- name: Install
run: |
pip3 install -r requirements.txt

- name: Test
run: |
coverage run -m pytest --verbose -o log_cli=true --log-cli-level=INFO src/

- name: Coverage
run: |
coverage report

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)

- name: Install tox and any other packages
run: pip install tox
- name: Run tox
run: tox -e py

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
8 changes: 1 addition & 7 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python
name: Python CI Tests

on:
push:
Expand Down Expand Up @@ -58,9 +58,3 @@ jobs:
- name: Coverage
run: |
coverage report

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
19 changes: 19 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sonar.projectKey=sir-gon_algorithm-exercises-py
sonar.organization=sir-gon

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=algorithm-exercises-py
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# sonar.sources=src
sonar.exclusions=**/*test.py,**/__init__.py

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

sonar.python.version=3.12

# Coverage
sonar.python.coverage.reportPaths=coverage.xml
16 changes: 16 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tox]
envlist = py39
skipsdist = True

[testenv]
deps =
pytest
coverage
commands =
coverage run -m pytest
coverage xml

[coverage:run]
relative_files = True
source = src/
branch = True
Loading