Skip to content

configure poetry

configure poetry #57

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
- name: Setup environment
run: poetry install
- name: Run Tests
run: poetry run pytest --cov klimalogger --cov-report xml --cov-report term --junitxml=junit.xml tests
- name: Build
run: poetry build
- name: SonarCloud Scan
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}