Add constant features treatment #55
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
pip install -q --upgrade pip | |
pip install -q cython | |
pip install -q numpy | |
pip install -q git+https://github.com/doctorado-ml/mdlp | |
pip install -q -r requirements/dev.txt | |
pip install -q --upgrade codecov coverage black flake8 codacy-coverage unittest-xml-reporting | |
- name: Lint | |
run: | | |
black --check --diff mufs | |
flake8 --count mufs | |
- name: Tests & coverage | |
run: | | |
mkdir .report | |
coverage run -m xmlrunner -v mufs.tests -o .report | |
coverage xml -i -o .report/coverage.xml | |
coverage report -m --fail-under=100 | |
- name: Get project version | |
run: echo "project_version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
- name: Override Coverage Source Path for Sonar | |
run: sed -i 's/\/home\/runner\/work\/mufs\/mufs\//\/github\/workspace\//g' .report/coverage.xml | |
- name: SonarQube scanner | |
uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
with: | |
args: > | |
-Dsonar.projectVersion=${{ env.project_version }} | |
-Dsonar.python.coverage.reportPaths=.report/coverage.xml | |
-Dsonar.python.xunit.reportPath=.report/TEST* | |
# If you wish to fail your job when the Quality Gate is red, uncomment the | |
# following lines. This would typically be used to fail a deployment. | |
- name: Quality Gate | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
timeout-minutes: 5 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |