Skip to content
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
17 changes: 9 additions & 8 deletions .github/workflows/QA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@ jobs:
with:
category: /language:python

codacy:
name: Codacy
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
upload: true
fetch-depth: 0

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

report-qa-status:
name: Report QA Status
runs-on: ubuntu-latest
needs: [ codeql, codacy ]
needs: [ codeql, sonarqube ]
if: always()

steps:
Expand Down
83 changes: 35 additions & 48 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@ on:
workflow_call:

jobs:
function-tests:
name: Function Tests
runs-on: ubuntu-latest

services:
api:
image: docker.cloudsmith.io/better-hpc/keystone/keystone-api
ports:
- 8000:8000

strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(vars.PYTHON_VERSIONS) }}

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false

- name: Install dependencies
run: poetry install --with tests

- name: Run tests
run: poetry run python -m unittest discover -s tests/function_tests
# function-tests:
# name: Function Tests
# runs-on: ubuntu-latest
#
# services:
# api:
# image: docker.cloudsmith.io/better-hpc/keystone/keystone-api
# ports:
# - 8000:8000
#
# strategy:
# fail-fast: false
# matrix:
# python-version: ${{ fromJson(vars.PYTHON_VERSIONS) }}
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v6
#
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v6
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Install Poetry
# uses: snok/install-poetry@v1
# with:
# virtualenvs-create: false
#
# - name: Install dependencies
# run: poetry install --with tests
#
# - name: Run tests
# run: poetry run python -m unittest discover -s tests/function_tests

unit-tests:
name: Unit Tests
Expand Down Expand Up @@ -71,26 +71,13 @@ jobs:
poetry run coverage report --omit="tests/*"
poetry run coverage xml --omit="tests/*" -o coverage.xml

- name: Report partial coverage results
if: github.event_name != 'release'
shell: bash
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Python -r coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

report-test-status:
name: Report Test Status
runs-on: ubuntu-latest
needs: [ unit-tests, function-tests ]
needs: [ unit-tests ]
if: always()

steps:
- name: Finish reporting coverage
shell: bash
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: Check test status
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }}
run: exit 1
2 changes: 2 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sonar.projectKey=Better-HPC_keystone-python-client
sonar.organization=better-hpc
Loading