Skip to content

chore: Another attempt to upload coverage to codeclimate #47

chore: Another attempt to upload coverage to codeclimate

chore: Another attempt to upload coverage to codeclimate #47

# It will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see:
# https://py-pkgs.org/08-ci-cd
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: test
# Controls when the workflow will run
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run
# sequentially or in parallel
jobs:
ci:
# Set up operating system
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10", "3.9"]
os: [ubuntu-latest, macOS-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pdm install -dG test
- name: Run Tests
run: |
pdm run pytest
# See: https://martinheinz.dev/blog/69 "Ultimate CI Pipeline for All of Your Python Projects"
- name: Use Codecov to track coverage
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml # coverage report
- name: Send report to CodeClimate
uses: paambaati/[email protected]
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
env:
CC_TEST_REPORTER_ID: ${?{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${?{github.workspace}}/coverage.xml
#- name: SonarCloud scanner
# uses: sonarsource/sonarcloud-github-action@master
# if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
# env:
# GITHUB_TOKEN: ${?{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${?{ secrets.SONAR_TOKEN }}