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

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

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v8
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@master

Check warning on line 37 in .github/workflows/QA.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/QA.yml#L37

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
upload: true

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

steps:
Expand Down
83 changes: 48 additions & 35 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,13 +71,26 @@ 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 ]
needs: [ unit-tests, function-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: 0 additions & 2 deletions sonar-project.properties

This file was deleted.

Loading