Skip to content
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

Add new basic ci pipeline #10215

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions .pipelines/NuGetGallery-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ extends:
inputs:
versionSpec: '3.10'
- script: |
python -m pip install --upgrade pip
pip install keyring artifacts-keyring
python -m pip install --user pipx
pipx ensurepath
displayName: 'Install tools'
- script: |
pipx install poetry
pipx inject poetry artifacts-keyring
poetry install
poetry build
poetry run pytest tests/ --cov loginterpretation --cov-report html
Expand Down
160 changes: 160 additions & 0 deletions .pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: NuGetGallery CI $(Build.BuildId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use 1ES template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for the public build as it's going to in dceng-public


trigger:
branches:
include:
- "*"
pr:
branches:
include:
- "*"

variables:
DOTNET_NOLOGO: true
BuildConfiguration: Release
nugetMultiFeedWarnLevel: none
CommonPackageVersion: $(CommonAssemblyVersion)-$(NuGetGalleryBranch)-$(Build.BuildId)
CommonAssemblyVersion: 5.0.0
GalleryPackageVersion: $(GalleryAssemblyVersion)-$(NuGetGalleryBranch)-$(Build.BuildId)
GalleryAssemblyVersion: 5.0.0
JobsPackageVersion: $(JobsAssemblyVersion)-$(NuGetGalleryBranch)-$(Build.BuildId)
JobsAssemblyVersion: 5.0.0
NuGetGalleryBranch: $(Build.SourceBranchName)

pool:
vmImage: 'windows-latest'
Copy link
Contributor

@erdembayar erdembayar Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is using different pool than existing NuGetGallery-CI.yml file. Why? Any reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing pool isn't meant for public builds


stages:
- stage: common
displayName: NuGet.Server.Common.sln
dependsOn: []
jobs:
- job: build_and_test
displayName: common build and test
cancelTimeoutInMinutes: 1
steps:
- task: PowerShell@1
name: build
displayName: Build
inputs:
scriptName: $(Agent.BuildDirectory)\build.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipArtifacts -SkipGallery -SkipJobs -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion)
workingFolder: $(Agent.BuildDirectory)
- task: PowerShell@1
name: test
displayName: Run tests
inputs:
scriptName: $(Agent.BuildDirectory)\test.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipGallery -SkipJobs
workingFolder: $(Agent.BuildDirectory)
- task: PublishTestResults@2
name: publish_test_results
displayName: Publish test results
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: $(Agent.BuildDirectory)\Results.*.xml
failTaskOnFailedTests: true

- stage: gallery
displayName: NuGetGallery.sln
dependsOn: []
jobs:
- job: build_and_test
displayName: gallery build and test
cancelTimeoutInMinutes: 1
steps:
- task: PowerShell@1
name: build
displayName: Build
inputs:
scriptName: $(Agent.BuildDirectory)\build.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipArtifacts -SkipCommon -SkipJobs -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion)
workingFolder: $(Agent.BuildDirectory)
- task: PowerShell@1
name: test
displayName: Run tests
inputs:
scriptName: $(Agent.BuildDirectory)\test.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipCommon -SkipJobs
workingFolder: $(Agent.BuildDirectory)
- task: PublishTestResults@2
name: publish_test_results
displayName: Publish test results
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: $(Agent.BuildDirectory)\Results.*.xml
failTaskOnFailedTests: true

- stage: statslogparser
displayName: StatsLogPasrser
dependsOn: []
jobs:
- job: build_and_test
displayName: statslogparser build and test
cancelTimeoutInMinutes: 1
variables:
PIPX_HOME: $(Agent.ToolsDirectory)\pipx
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
- script: |
python -m pip install --upgrade pip
python -m pip install --user pipx
pipx ensurepath
displayName: 'Install tools'
- script: |
pipx install poetry
poetry install
poetry build
poetry run pytest tests/ --cov loginterpretation --cov-report html
workingDirectory: $(Agent.BuildDirectory)\python\StatsLogParser

- stage: jobs
displayName: NuGet.Jobs.sln
dependsOn: []
jobs:
- job: build_and_test
displayName: jobs build and test
cancelTimeoutInMinutes: 1
steps:
- task: PowerShell@1
name: build
displayName: Build
inputs:
scriptName: $(Agent.BuildDirectory)\build.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipArtifacts -SkipCommon -SkipGallery -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion)
workingFolder: $(Agent.BuildDirectory)
- task: PowerShell@1
name: test
displayName: Run tests
inputs:
scriptName: $(Agent.BuildDirectory)\test.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipCommon -SkipGallery
workingFolder: $(Agent.BuildDirectory)
- task: PublishTestResults@2
name: publish_test_results
displayName: Publish test results
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: $(Agent.BuildDirectory)\Results.*.xml
failTaskOnFailedTests: true

- stage: artifacts
displayName: Artifacts
dependsOn: []
jobs:
- job: build_artifacts
displayName: build
cancelTimeoutInMinutes: 1
steps:
- task: PowerShell@1
name: build_artifacts
displayName: Build
inputs:
scriptName: $(Agent.BuildDirectory)\build.ps1
arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion)
workingFolder: $(Agent.BuildDirectory)
77 changes: 76 additions & 1 deletion python/StatsLogParser/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions python/StatsLogParser/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ pytest = "^8.3.2"
pytest-cov = "^5.0.0"
pytest-azurepipelines = "^1.0.5"


[[tool.poetry.source]]
name = "dceng-public"
url = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-pypi/pypi/simple/"
priority = "primary"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"