From 48acdd9274b7bbb3b6e61ac786ae1ebd6bc702cd Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky Date: Tue, 21 Apr 2020 17:53:37 +0300 Subject: [PATCH 1/6] Extract nuget push from build pipeline --- azure-pipelines.yml | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 377958e..c1cb0fc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -137,28 +137,11 @@ steps: **/*Tests*/Log/*.log TargetFolder: '$(Build.ArtifactStagingDirectory)' condition: succeededOrFailed() - -- task: PublishBuildArtifacts@1 - displayName: 'Publish copied artifacts' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' - publishLocation: 'Container' - condition: succeededOrFailed() - script: dotnet pack Aquality.Appium.Mobile/src/Aquality.Appium.Mobile/Aquality.Appium.Mobile.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) displayName: 'Create NuGet package' condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - -- task: NuGetCommand@2 - displayName: 'Push NuGet package' - inputs: - command: 'push' - packagesToPush: '$(Build.ArtifactStagingDirectory)/**/Aquality.Appium.Mobile*.nupkg;!$(Build.ArtifactStagingDirectory)/**/Aquality.Appium.Mobile*.symbols.nupkg' - nuGetFeedType: 'external' - publishFeedCredentials: 'NuGet' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - + - task: GitHubRelease@0 displayName: 'Create tag on GitHub' inputs: @@ -168,4 +151,10 @@ steps: tag: 'v$(GitVersion.NuGetVersion)' tagSource: 'manual' isPreRelease: contains(variables['GitVersion.NuGetVersion'], '-') + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) + +- task: PublishBuildArtifacts@1 + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)' + artifactName: '_aquality-automation.aquality-appium-mobile-dotnet' condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file From b4dce18aaa4249a26a0a2cda18d86879ad0d53fd Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky Date: Wed, 22 Apr 2020 11:30:20 +0300 Subject: [PATCH 2/6] Add artifacts publishing --- .../Android/NativeApp/AndroidBasicInteractionsTest.cs | 2 ++ azure-pipelines.yml | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs b/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs index 952d853..928391d 100644 --- a/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs +++ b/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs @@ -16,6 +16,8 @@ public void TearDown() [Test] public void SendKeys() { + Assert.Fail("Test fail"); // TODO: remove it after test + var searchScreen = new InvokeSearchScreen(); searchScreen.Open(); Assume.That(searchScreen.IsDisplayed, $"{searchScreen.Name} should be opened from the menu"); diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c1cb0fc..d811acf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -138,6 +138,13 @@ steps: TargetFolder: '$(Build.ArtifactStagingDirectory)' condition: succeededOrFailed() +- task: PublishBuildArtifacts@1 + displayName: 'Publish copied artifacts' + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop' + condition: succeededOrFailed() + - script: dotnet pack Aquality.Appium.Mobile/src/Aquality.Appium.Mobile/Aquality.Appium.Mobile.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) displayName: 'Create NuGet package' condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) @@ -157,4 +164,4 @@ steps: inputs: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: '_aquality-automation.aquality-appium-mobile-dotnet' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file + #condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file From 00f75f275261a6fa9f9f005cf5b41fd8c633127a Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky Date: Wed, 22 Apr 2020 11:48:22 +0300 Subject: [PATCH 3/6] Test pipeline --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d811acf..f62e4ee 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -147,7 +147,8 @@ steps: - script: dotnet pack Aquality.Appium.Mobile/src/Aquality.Appium.Mobile/Aquality.Appium.Mobile.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) displayName: 'Create NuGet package' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) + condition: succeededOrFailed() + #condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - task: GitHubRelease@0 displayName: 'Create tag on GitHub' @@ -164,4 +165,5 @@ steps: inputs: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: '_aquality-automation.aquality-appium-mobile-dotnet' + condition: succeededOrFailed() #condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file From f8db7c2e50912a6f4d5e3d37228d316d5b32903a Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky Date: Wed, 22 Apr 2020 11:59:50 +0300 Subject: [PATCH 4/6] Test pipeline --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f62e4ee..25b7cab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -165,5 +165,5 @@ steps: inputs: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: '_aquality-automation.aquality-appium-mobile-dotnet' - condition: succeededOrFailed() + condition: succeededOrFailed() #condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file From 93fd6871a96b094ab00c1675a495fa9778e10af2 Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky Date: Wed, 22 Apr 2020 12:30:55 +0300 Subject: [PATCH 5/6] Test pipeline --- .../Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs | 2 -- azure-pipelines.yml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs b/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs index 928391d..952d853 100644 --- a/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs +++ b/Aquality.Appium.Mobile/tests/Aquality.Appium.Mobile.Tests/Samples/Android/NativeApp/AndroidBasicInteractionsTest.cs @@ -16,8 +16,6 @@ public void TearDown() [Test] public void SendKeys() { - Assert.Fail("Test fail"); // TODO: remove it after test - var searchScreen = new InvokeSearchScreen(); searchScreen.Open(); Assume.That(searchScreen.IsDisplayed, $"{searchScreen.Name} should be opened from the menu"); diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 25b7cab..7e8f7a3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -148,7 +148,7 @@ steps: - script: dotnet pack Aquality.Appium.Mobile/src/Aquality.Appium.Mobile/Aquality.Appium.Mobile.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) displayName: 'Create NuGet package' condition: succeededOrFailed() - #condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - task: GitHubRelease@0 displayName: 'Create tag on GitHub' @@ -166,4 +166,4 @@ steps: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: '_aquality-automation.aquality-appium-mobile-dotnet' condition: succeededOrFailed() - #condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file From 79e2fbd882f8b2bda1c77b564e70031e1495e9ac Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky Date: Wed, 22 Apr 2020 12:32:01 +0300 Subject: [PATCH 6/6] Fix pipeline --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e8f7a3..7d27eb1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -147,7 +147,6 @@ steps: - script: dotnet pack Aquality.Appium.Mobile/src/Aquality.Appium.Mobile/Aquality.Appium.Mobile.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) displayName: 'Create NuGet package' - condition: succeededOrFailed() condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - task: GitHubRelease@0 @@ -165,5 +164,4 @@ steps: inputs: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: '_aquality-automation.aquality-appium-mobile-dotnet' - condition: succeededOrFailed() condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file