build(tests): lint, unit tests, and ci for that #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- reopened | |
- synchronize | |
jobs: | |
python-tests: | |
name: Run python tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
with: | |
python-version: 3.11 | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
tox -e py | |
- name: Build coverage file | |
run: | | |
tox -e py | |
# pytest --cache-clear --junitxml=coverage.xml --cov-report=term-missing:skip-covered --cov=mlflow_oidc_auth > pytest-coverage.txt | |
- name: Override Coverage Source Path for Sonar | |
run: sed -i "s@<source>/home/runner/work/mlflow-oidc-auth/mlflow-oidc-auth</source>@<source>/github/workspace</source>@g" /home/runner/work/mlflow-oidc-auth/mlflow-oidc-auth/coverage.xml | |
- name: debug cov | |
run: | | |
pwd | |
ls -alh | |
head -n50 coverage.xml | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@e44258b109568baa0df60ed515909fc6c72cba92 # v2.3.0 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
# todo: remove GH App |