diff --git a/.github/workflows/QA.yml b/.github/workflows/QA.yml index d324aff..f86a460 100644 --- a/.github/workflows/QA.yml +++ b/.github/workflows/QA.yml @@ -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: diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 960c595..30938eb 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -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 @@ -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 diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..c37021e --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=Better-HPC_keystone-python-client +sonar.organization=better-hpc