Skip to content

Fixes #11: remove depreciated const argument #59

Fixes #11: remove depreciated const argument

Fixes #11: remove depreciated const argument #59

name: Python package
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --show-source --statistics
- name: Test with pytest
run: |
pytest --cov=ssaw --cov-report=xml --junitxml=pytests.xml
- name: Persist code coverage results
uses: actions/upload-artifact@v2
with:
name: coverage
path: |
coverage.xml
pytests.xml
analyze:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download code coverage results
uses: actions/download-artifact@v2
with:
name: coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: coverage.xml
fail_ci_if_error: true
verbose: true
- name: Fix source path in coverage.xml
run: sed -i 's|'$GITHUB_WORKSPACE'|/github/workspace|' coverage.xml
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=vavalomi
-Dsonar.projectKey=vavalomi_ssaw
-Dsonar.python.version=3.6
-Dsonar.python.xunit.reportPath=pytests.xml
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.sources=ssaw/
-Dsonar.tests=tests/
-Dsonar.sourceEncoding=UTF-8
-Dsonar.verbose=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}