diff --git a/azure-bootstrap.yml b/azure-bootstrap.yml new file mode 100644 index 0000000..ea6fb49 --- /dev/null +++ b/azure-bootstrap.yml @@ -0,0 +1,42 @@ +# Copyright (c) .NET Foundation and Contributors +# See LICENSE file in the project root for full license information. + +trigger: + branches: + include: + - main + - develop + - release-* + paths: + exclude: + - .gitignore + - CHANGELOG.md + - LICENSE.md + - README.md + - NuGet.Config + - assets/* + - .github/* + +# PR always trigger build +pr: + autoCancel: true + +# add nf-tools repo to resources (for Azure Pipelines templates) +resources: + repositories: + - repository: templates + type: github + name: nanoframework/nf-tools + endpoint: nanoframework + +jobs: +- job: Trigger + displayName: Trigger Azure Dev Ops build and test pipeline + pool: + vmImage: 'ubuntu-latest' + + steps: + - template: azure-pipelines-templates/device-bootstrap.yml@templates + parameters: + AZURE_DEVOPS_PROJECT: nanoFramework.Json + AZURE_DEVOPS_PIPELINE_ID: 59 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 70c5559..a8396b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,28 +1,10 @@ # Copyright (c) .NET Foundation and Contributors # See LICENSE file in the project root for full license information. -trigger: - branches: - include: - - main - - develop - - release-* - paths: - exclude: - - .github_changelog_generator - - .gitignore - - CHANGELOG.md - - CODE_OF_CONDUCT.md - - LICENSE.md - - README.md - - NuGet.Config - - assets/* - - config/* - - .github/* - -# PR always trigger build -pr: - autoCancel: true +# The Pipeline is going to be triggered by a call to Azure DevOps REST API +# Manual trigger is always possible. +trigger: none +pr: none # add nf-tools repo to resources (for Azure Pipelines templates) resources: @@ -48,20 +30,49 @@ variables: - name: nugetPackageName value: 'nanoFramework.Json' -steps: +parameters: +- name: appComponents + displayName: List of capabilities to run the tests on + type: object + default: + - none + +stages: +- stage: Build + displayName: 'Build' + jobs: + - job: Build + displayName: 'Build job' + pool: + # default is the following VM Image + vmImage: 'windows-latest' + steps: + + # step from template @ nf-tools repo + # all build, update and publish steps + - template: azure-pipelines-templates/class-lib-build.yml@templates + parameters: + sonarCloudProject: 'nanoframework_lib-nanoFramework.Json' + runUnitTests: true + unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings' + + # step from template @ nf-tools repo + # report error + - template: azure-pipelines-templates/discord-webhook-task.yml@templates + parameters: + status: 'failure' + webhookUrl: '$(DiscordWebhook)' + message: '' -# step from template @ nf-tools repo -# all build, update and publish steps -- template: azure-pipelines-templates/class-lib-build.yml@templates - parameters: - sonarCloudProject: 'nanoframework_lib-nanoFramework.Json' - runUnitTests: true - unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings' + - task: PublishPipelineArtifact@1 + displayName: Publish Pipeline Artifact copy + inputs: + path: '$(System.DefaultWorkingDirectory)' + artifactName: 'Artifacts' -# step from template @ nf-tools repo -# report error -- template: azure-pipelines-templates/discord-webhook-task.yml@templates - parameters: - status: 'failure' - webhookUrl: '$(DiscordWebhook)' - message: '' +- ${{ each appComponents in parameters.appComponents }}: + - template: azure-pipelines-templates/device-test.yml@templates + parameters: + appComponents: ${{ appComponents }} + unitTestRunsettings: + - 'nanoFramework.Json.Test/nano.runsettings,nanoFramework.Json.Test/bin/Release/NFUnitTest.dll' diff --git a/nanoFramework.Json.Test/nano.runsettings b/nanoFramework.Json.Test/nano.runsettings index e82b99e..7d1bdd0 100644 --- a/nanoFramework.Json.Test/nano.runsettings +++ b/nanoFramework.Json.Test/nano.runsettings @@ -11,5 +11,6 @@ None False + COM3 \ No newline at end of file