Skip to content

Commit

Permalink
use relative files (#564)
Browse files Browse the repository at this point in the history
* use relative files

* added version specifications

* updated testing workflow to separate sonarcloud into sep job
  • Loading branch information
SteveMcGrath authored May 2, 2022
1 parent f1b8caf commit a930d96
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
relative_files = True
48 changes: 26 additions & 22 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ jobs:
pip install -r requirements.txt
- name: Run the unit test suite.
run: |
pytest tests \
--vcr-record=none \
--cov-report term-missing \
--cov-report xml \
pytest tests \
--vcr-record=none \
--cov-report term-missing \
--cov-report xml:cov/coverage.xml \
--cov=tenable tests
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Test if the library is installable
run: |
pip install .
cd aux_tests && pytest test_installable.py
- name: Save Coverage Report
uses: actions/upload-artifact@v2
with:
name: coverage_report_${{ matrix.python-version }}
path: cov
retention-days: 1

style:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,7 +73,7 @@ jobs:
--max-complexity=12 \
--statistics
security:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -83,19 +88,18 @@ jobs:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: snyk test --org=pytenable

installable:
sonarcloud:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
needs: unit_tests
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Download Coverage Report
uses: actions/download-artifact@v2
with:
python-version: ${{ matrix.python-version }}
- name: "Install package and test"
run: |
pip install pytest
pip install .
cd aux_tests && pytest test_installable.py
name: coverage_report_3.8
path: cov
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 2 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ sonar.projectKey=tenable_pyTenable
sonar.organization=tenable
sonar.sources=tenable
sonar.tests=tests
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.version=3.6, 3.7, 3.8, 3.9, 3.10
sonar.python.coverage.reportPaths=cov/coverage.xml

0 comments on commit a930d96

Please sign in to comment.