Skip to content

Forcing builder

Forcing builder #1316

Workflow file for this run

name: SonarCloud analysis
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ewatercycle
environment-file: environment.yml
mamba-version: "*"
python-version: "3.10"
miniconda-version: "latest"
channels: conda-forge
- name: Install dependencies
shell: bash -l {0}
run: |
pip3 install -e .[dev]
- name: Run pre commit hooks like linters and black formatter
uses: pre-commit/[email protected]
- name: Tests with coverage
run: |
pytest --cov --cov-report term --cov-report xml \
--junitxml=xunit-result.xml
shell: bash -l {0}
- name: Correct coverage paths
run: sed -i "s+$PWD/++g" coverage.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}