Skip to content

Refactor/python docstrings for dummy estimator #1004

Refactor/python docstrings for dummy estimator

Refactor/python docstrings for dummy estimator #1004

name: run-pytest-and-sonarcloud
on:
push:
branches:
- '**'
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- develop
- main
jobs:
builds-and-run-pytest-coverage:
runs-on: ubuntu-22.04
concurrency: ci-${{github.ref}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v4
id: built-image
with:
context: .
push: false
load: true
tags: estimators-lib:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Run pytest with coverage
run: docker run --rm -v $PWD:/home/cryptographic_estimators estimators-lib make docker-pytest-cov
- name: Override Coverage Source Path for Sonar
run: sed -i "s/<source>\/home\/cryptographic_estimators\/cryptographic_estimators<\/source>/<source>\/github\/workspace\/cryptographic_estimators<\/source>/g" coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.branch.name=${{ env.GITHUB_HEAD_REF }}
-Dsonar.python.coverage.reportPaths=coverage.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}