Skip to content

Commit

Permalink
Merge branch 'feature/CI' of https://github.com/SURGroup/UQpy into fe…
Browse files Browse the repository at this point in the history
…ature/CI
  • Loading branch information
dgiovanis committed Feb 12, 2021
2 parents 02b337c + 51751bf commit 6003a30
Showing 1 changed file with 53 additions and 51 deletions.
104 changes: 53 additions & 51 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,20 @@ steps:
displayName: Shows currently compiling version
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# - task: SonarCloudPrepare@1
# condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/#master'),eq(variables['Build.SourceBranch'], 'refs/heads/Development'),eq(variables['Build.Reason'], #'PullRequest'))
# inputs:
# SonarCloud: 'dimtsap.UQpy'
# organization: 'dimtsap-github'
# scannerMode: 'CLI'
# configMode: 'manual'
# cliProjectKey: 'sonar.uqpy'
# cliProjectName: 'sonar.uqpy'
# cliSources: '.'
# extraProperties: |
# sonar.exclusions=**/example/**
# sonar.python.coverage.reportPaths=./coverage.xml
- task: SonarCloudPrepare@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.SourceBranch'], 'refs/heads/Development'),eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/feature/CI'))
inputs:
SonarCloud: 'SonarCloud.UQpy'
organization: 'jhusurg'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'SURGroup_UQpy'
cliProjectName: 'UQpy'
cliSources: '.'
extraProperties: |
sonar.exclusions=**/example/**
sonar.python.coverage.reportPaths=./coverage.xml
sonar.branch.name=feature/CI
- script: pip install -r requirements.txt
displayName: Install project dependencies
Expand All @@ -80,18 +81,18 @@ steps:
#workingDirectory: $(Build.SourcesDirectory)
#displayName: 'Test with pytest'

- script: |
pip install pytest
pip install pytest-cov
pip install pytest pytest-azurepipelines
pip install numpy
pip install matplotlib
pip install -U scikit-learn
echo "##vso[task.setvariable variable=PATH]${PATH}:$(Build.SourcesDirectory)/src/UQpy"
# python -m pytest tests/ --import-mode=importlib --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
pytest tests/*.py --cov-config .coveragerc --import-mode=importlib --doctest-modules --junitxml=junit/test-results.xml --cov=src --cov-report=xml --cov-report=html
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Test with pytest'
#- script: |
# pip install pytest
# pip install pytest-cov
# pip install pytest pytest-azurepipelines
# pip install numpy
# pip install matplotlib
# pip install -U scikit-learn
# echo "##vso[task.setvariable variable=PATH]${PATH}:$(Build.SourcesDirectory)/src/UQpy"
# # python -m pytest tests/ --import-mode=importlib --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
# pytest tests/*.py --cov-config .coveragerc --import-mode=importlib --doctest-modules --junitxml=junit/test-results.xml --cov=src --cov-report=xml --cov-report=html
# workingDirectory: $(Build.SourcesDirectory)
# displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
Expand All @@ -106,37 +107,38 @@ steps:
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/ **'

# - task: SonarCloudAnalyze@1
# condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/#master'),eq(variables['Build.SourceBranch'], 'refs/heads/Development'),eq(variables['Build.Reason'], #'PullRequest'))
- task: SonarCloudAnalyze@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.SourceBranch'], 'refs/heads/Development'),eq(variables['Build.Reason'], 'PullRequest'),eq(variables['Build.SourceBranch'], 'refs/heads/feature/CI'))

# - task: SonarCloudPublish@1
# condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/#master'),eq(variables['Build.SourceBranch'], 'refs/heads/Development'),eq(variables['Build.Reason'], #'PullRequest'))
# inputs:
# pollingTimeoutSec: '300'
- task: SonarCloudPublish@1
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),eq(variables['Build.SourceBranch'], 'refs/heads/Development'),eq(variables['Build.Reason'], 'PullRequest'),eq(variables['Build.SourceBranch'], 'refs/heads/feature/CI'))
inputs:
pollingTimeoutSec: '300'

# - script: |
# python setup.py $(GitVersion.SemVer) sdist bdist_wheel
# displayName: Artifact creation
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- script: |
#python setup.py $(GitVersion.SemVer) sdist bdist_wheel
python setup.py 100.0.1 sdist bdist_wheel
displayName: Artifact creation
#condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# - task: CopyFiles@2
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# SourceFolder: 'dist'
# Contents: '**'
# TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: CopyFiles@2
#condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
SourceFolder: 'dist'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

# - task: PublishBuildArtifacts@1
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# inputs:
# PathtoPublish: '$(Build.ArtifactStagingDirectory)'
# ArtifactName: 'dist'
# publishLocation: 'Container'
- task: PublishBuildArtifacts@1
#condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'dist'
publishLocation: 'Container'

# - script: |
# twine upload --repository-url https://test.pypi.org/legacy/ dist/* --username "$(TESTPYPIU)" #--password "$(TESTPYPIP)"
# displayName: Upload to Test PyPi
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- script: |
twine upload --repository-url https://test.pypi.org/legacy/ dist/* --username "$(TESTPYPIU)" #--password "$(TESTPYPIP)"
displayName: Upload to Test PyPi
#condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# - task: GitHubRelease@1
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
Expand Down

0 comments on commit 6003a30

Please sign in to comment.