Ignore .idea (#71) #41
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: build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run tests | |
run: | | |
git fetch --all --prune | |
sudo apt-get install libgeos-dev -y | |
export PROJECT_PATH=$(pwd) | |
echo $PROJECT_PATH | |
ls -lahrt ${PROJECT_PATH} | |
python -m pip install --upgrade pip | |
pip install coverage runtype wheel twine setuptools | |
cd ${PROJECT_PATH}/equipment/framework && pip install -r requirements.txt | |
cd ${PROJECT_PATH}/equipment/console && pip install -r requirements.txt | |
cd ${PROJECT_PATH}/equipment/project && pip install -r requirements.txt | |
cd ${PROJECT_PATH} && python -m unittest discover -s equipment/project/ | |
cd ${PROJECT_PATH} && coverage run -m unittest discover -p '**Test.py' | |
cd ${PROJECT_PATH} && coverage xml -i | |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml | |
- name: SonarCloud Scan | |
if: ${{ matrix.python-version == '3.10'}} | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.SONAR_GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.organization=rogervila-github | |
-Dsonar.projectKey=rogervila_equipment | |
-Dsonar.sources=. | |
-Dsonar.python.version=3.10 | |
-Dsonar.python.coverage.reportPaths=coverage.xml | |
-Dsonar.exclusions=**/tests/**,**/*.html,**/*.js,**/*.css,**/stubs/**,**/_stubs/**,**/examples/**,**/project/main.py | |
-Dsonar.test.exclusions=**/tests/**,**/*.html,**/*.js,**/*.css,**/stubs/**,**/_stubs/**,**/examples/**,**/project/main.py | |
-Dsonar.tests=equipment/console/tests/,equipment/framework/tests/,equipment/project/tests/ | |
-Dsonar.verbose=true |