-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v1.x] Add 1ES CI pipelines (#10211)
* Add 1ES CI to v1.x * Fix nuget.config * Fix nuget.config * update build_number * Split v1 build into official/public/test * Extra variables to template * Add release/1.* to triggers * Remove eng resource from public * Fix public pool * Replace secret with 'PLACEHOLDER' * Add all env vars for tests * Do not run tests on public ci * Add eng resource to integration-tests.yml * Fix missing job * Fix filter * Fix runtests.ps1 * Skip strong names for tests
- Loading branch information
Showing
10 changed files
with
289 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="nuget.org" value="https://www.nuget.org/api/v2/" /> | ||
<add key="azure_app_service" value="https://www.myget.org/F/azure-appservice/api/v2" /> | ||
<add key="buildTools" value="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" /> | ||
<clear /> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
<add key="v1-tools" value="https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/v1-tools/nuget/v3/index.json" /> | ||
<add key="azure-app-service" value="https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/myget-backup-azure-app-service/nuget/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- dev | ||
- in-proc | ||
- v1.x | ||
- v3.x | ||
- release/1.* | ||
- release/3.* | ||
- release/4.* | ||
- release/in-proc | ||
|
||
resources: | ||
repositories: | ||
- repository: eng | ||
type: git | ||
name: engineering | ||
ref: refs/tags/release | ||
|
||
variables: | ||
- template: ci/variables/cfs.yml@eng | ||
|
||
extends: | ||
template: ci/code-mirror.yml@eng |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
trigger: none | ||
|
||
pr: | ||
branches: | ||
include: | ||
- v1.x | ||
- release/1.* | ||
|
||
resources: | ||
repositories: | ||
- repository: 1es | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
- repository: eng | ||
type: git | ||
name: engineering | ||
ref: refs/tags/release | ||
|
||
variables: | ||
- template: /ci/variables/cfs.yml@eng | ||
- template: /eng/ci/templates/variables/build.yml@self | ||
|
||
extends: | ||
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es | ||
parameters: | ||
pool: | ||
name: 1es-pool-azfunc | ||
image: 1es-windows-2022 | ||
os: windows | ||
|
||
stages: | ||
- stage: Test | ||
jobs: | ||
- job: Test | ||
steps: | ||
- template: /eng/ci/templates/steps/build.yml@self | ||
parameters: | ||
configuration: $(configuration) | ||
targets: EnableSkipStrongNames;TestBuild | ||
|
||
- template: /eng/ci/templates/steps/test.yml@self | ||
parameters: | ||
configuration: $(configuration) | ||
results_path: $(test_results_path) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- v1.x | ||
- release/1.* | ||
|
||
resources: | ||
repositories: | ||
- repository: 1es | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
- repository: eng | ||
type: git | ||
name: engineering | ||
ref: refs/tags/release | ||
|
||
variables: | ||
- template: /ci/variables/cfs.yml@eng | ||
- template: /eng/ci/templates/variables/build.yml@self | ||
|
||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1es | ||
parameters: | ||
pool: | ||
name: 1es-pool-azfunc | ||
image: 1es-windows-2022 | ||
os: windows | ||
|
||
stages: | ||
- stage: BuildAndTest | ||
|
||
jobs: | ||
- job: BuildAndTest | ||
templateContext: | ||
outputParentDirectory: $(publish_path) | ||
outputs: | ||
- output: pipelineArtifact | ||
displayName: Publish drop | ||
path: $(publish_path)/Packages | ||
artifact: drop | ||
|
||
steps: | ||
- template: /eng/ci/templates/steps/build.yml@self | ||
parameters: | ||
configuration: $(configuration) | ||
publish_path: $(publish_path) | ||
build_number: $(build_number) | ||
|
||
- template: /eng/ci/templates/steps/test.yml@self | ||
parameters: | ||
configuration: $(configuration) | ||
results_path: $(test_results_path) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- v1.x | ||
- release/1.* | ||
|
||
pr: | ||
branches: | ||
include: | ||
- v1.x | ||
- release/1.* | ||
|
||
resources: | ||
repositories: | ||
- repository: 1es | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
|
||
variables: | ||
- template: /eng/ci/templates/variables/build.yml@self | ||
|
||
extends: | ||
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es | ||
parameters: | ||
pool: | ||
name: 1es-pool-azfunc-public | ||
image: 1es-windows-2022 | ||
os: windows | ||
|
||
stages: | ||
- stage: Build | ||
|
||
jobs: | ||
- job: Build | ||
templateContext: | ||
outputParentDirectory: $(publish_path) | ||
outputs: | ||
- output: pipelineArtifact | ||
displayName: Publish drop | ||
path: $(publish_path)/Packages | ||
artifact: drop | ||
|
||
steps: | ||
- template: /eng/ci/templates/steps/build.yml@self | ||
parameters: | ||
configuration: $(configuration) | ||
publish_path: $(publish_path) | ||
build_number: $(build_number) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
parameters: | ||
- name: configuration | ||
type: string | ||
default: Release | ||
- name: publish_path | ||
type: string | ||
default: bin | ||
- name: build_number | ||
type: string | ||
default: '4242' | ||
- name: targets | ||
type: string | ||
default: EnableSkipStrongNames;PackageScriptHost;PackageWebHost;TestBuild | ||
|
||
steps: | ||
- task: MSBuild@1 | ||
inputs: | ||
solution: WebJobs.Script.proj | ||
msbuildArguments: '/target:${{ parameters.targets }} /property:BuildNumber=${{ parameters.build_number }};Configuration=${{ parameters.configuration }};PublishPath=${{ parameters.publish_path }}' | ||
logFileVerbosity: minimal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
parameters: | ||
- name: configuration | ||
type: string | ||
default: Release | ||
- name: results_path | ||
type: string | ||
default: $(System.DefaultWorkingDirectory)/test-results | ||
|
||
steps: | ||
- ${{ if ne(variables['System.TeamProject'], 'internal') }}: | ||
- pwsh: | | ||
Write-Host "##vso[task.LogIssue type=error;]Tests cannot be ran in this Azure Devops project." | ||
exit 1 | ||
displayName: Fail invalid project | ||
- ${{ else }}: | ||
- task: AzureKeyVault@1 | ||
inputs: | ||
# Note: This is actually a Service Connection in DevOps, not an Azure subscription name | ||
azureSubscription: Azure-Functions-Host-CI-internal | ||
keyVaultName: azurefunctionshostciv1 | ||
secretsFilter: '*' | ||
|
||
- task: UseNode@1 | ||
displayName: Install Node 6.11.2 | ||
inputs: | ||
version: '6.11.2' | ||
|
||
- pwsh: .\runtests.ps1 -ResultsPath ${{ parameters.results_path }} -Configuration ${{ parameters.configuration }} | ||
displayName: Run tests | ||
env: | ||
# many of these will be empty if running unit tests, which is fine. | ||
AzureWebJobsStorage: $(Storage) | ||
AzureWebJobsDashboard: $(Storage) | ||
AzureWebJobsServiceBus: $(ServiceBus) | ||
AzureWebJobsDocumentDBConnectionString: $(CosmosDB) | ||
AzureWebJobsMobileAppUri: $(MobileUri) | ||
AzureWebJobs_TestMobileUri: $(MobileUri) | ||
AzureWebJobsDropBox: UseLocalFileSystem=true;Path=%TEMP%\DropBox | ||
AzureWebJobsEventHubSender: $(EventHub) | ||
AzureWebJobsEventHubReceiver: $(EventHub) | ||
AzureWebJobsEventHubPath: testhub | ||
AzureWebJobsNotificationHubsConnectionString: $(NotificationHub) | ||
AzureWebJobsNotificationHubName: testhub | ||
AzureWebJobsEnv: Development | ||
AzureWebJobsScriptRoot: $(System.DefaultWorkingDirectory)\test\WebJobs.Script.Tests.Integration\TestScripts\Empty | ||
AzureWebJobsCosmosDBConnectionString: $(CosmosDB) | ||
AzureWebJobsSecretStorageKeyVaultName: $(KeyVaultName) | ||
AzureWebJobsSecretStorageKeyVaultConnectionString: $(KeyVaultConnectionString) | ||
ConnectionStrings__CosmosDB: $(CosmosDB2) | ||
FILES_ACCOUNT_NAME: $(FilesAccountName) | ||
FILES_ACCOUNT_KEY: $(FilesAccountKey) | ||
MOCHA_FILE: ${{ parameters.results_path }}/junit-test-results.xml | ||
TMP: $(Agent.TempDirectory) | ||
|
||
- task: PublishTestResults@2 | ||
displayName: Publish XUnit test results | ||
inputs: | ||
testResultsFormat: XUnit | ||
testResultsFiles: ${{ parameters.results_path }}/xunit-*.xml | ||
mergeTestResults: true | ||
buildConfiguration: $(configuration) | ||
testRunTitle: XUnit Tests | ||
condition: always() | ||
|
||
|
||
- task: PublishTestResults@2 | ||
displayName: Publish JUnit test results | ||
inputs: | ||
testResultsFormat: JUnit | ||
testResultsFiles: ${{ parameters.results_path }}/junit-*.xml | ||
mergeTestResults: true | ||
buildConfiguration: $(configuration) | ||
testRunTitle: JUnit Tests | ||
condition: always() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
variables: | ||
- name: DOTNET_NOLOGO | ||
value: 1 | ||
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE | ||
value: 1 | ||
- name: DOTNET_CLI_TELEMETRY_OPTOUT | ||
value: 1 | ||
- name: build_number | ||
value: $[ counter('constant-v1x', 23000) ] | ||
- name: includeBuildNumberInVersion | ||
value: 1 | ||
- name: configuration | ||
value: Release | ||
- name: publish_path | ||
value: bin | ||
- name: test_results_path | ||
value: $(System.DefaultWorkingDirectory)\test-results |
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
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