Skip to content

Revert to 8c-32g builder #75

Revert to 8c-32g builder

Revert to 8c-32g builder #75

Workflow file for this run

name: Test Python aswfdocker Library - Sonar
on:
push:
branches:
- master
jobs:
sonar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pipenv'
- name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
- name: Install aswfdocker and dev dependencies with pipenv
run: pipenv install --dev
# mypy static type checks with junit XML report
- name: Run mypy
run: pipenv run mypy python/aswfdocker --junit-xml=test-mypy-results.xml
# python unittests with junit XML report, PyLint and coverage XML Cobertura report for publishing task
- name: Run pylint linter
run: pipenv run pytest python/aswfdocker --doctest-modules --pylint --junitxml=test-pylint-results.xml --cov=. --cov-report=xml
- name: Fetch unshallow to help sonar
run: git fetch --unshallow
- name: Install and Run Sonar Scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
export SONAR_SCANNER_VERSION=4.2.0.1873
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
sonar-scanner \
-Dsonar.organization=academysoftwarefoundation \
-Dsonar.projectKey=AcademySoftwareFoundation_aswf_docker \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.projectDate=`git log $tag -n 1 --date=short --pretty="%ad"` \
-Dsonar.projectVersion=`pipenv run python setup.py --version`