Skip to content

WIP: ci, cd, environment and security improvements #951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

branches:
include:
- master
tags:
include:
- v*

jobs:

Expand Down Expand Up @@ -34,12 +38,5 @@ jobs:
dependsOn: 'Test_conda_linux'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'

- script: python setup.py sdist
displayName: 'Build sdist'
- template: ci/azure/publish.yml
9 changes: 7 additions & 2 deletions ci/azure/conda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python35-windows-min:
python.version: '35-min'
Python35:
python.version: '35'
Python36:
Expand All @@ -34,8 +36,9 @@ jobs:
displayName: 'List installed dependencies'
- script: |
source activate test_env
export NREL_API_KEY=$(nrelApiKey)
pytest pvlib --remote-data --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
env:
NREL_API_KEY: $(nrelApiKey)
displayName: 'pytest'
- task: PublishTestResults@2
inputs:
Expand All @@ -48,6 +51,8 @@ jobs:
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['coverage'], true)
- script: |
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
bash <(curl https://codecov.io/bash) -t $CODECOV_TOKEN -f coverage.xml -F adder -F subtractor -F conda
env:
CODECOV_TOKEN: $(codecov_token)
displayName: 'codecov'
condition: eq(variables['coverage'], true)
21 changes: 21 additions & 0 deletions ci/azure/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'

- script: pip install wheel twine
displayName: 'Install distribution dependencies'

- script: python setup.py sdist bdist_wheel
displayName: 'Build sdist and wheel'

- script: |
python -m twine upload dist/*
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'tags'))
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: $(TEST_PYPI_API_KEY)
TWINE_REPOSITORY_URL: 'https://test.pypi.org/legacy/'
displayName: 'Upload to PyPI'