Skip to content

Commit 4e7fd26

Browse files
Ivan KamkinIvan Kamkin
authored andcommitted
Added snippets test to ci
1 parent fdb8e2a commit 4e7fd26

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/workflows/build-examples.yml renamed to .github/workflows/test-examples-and-snippets.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
- name: Setup latest version of dotnet
1616
uses: actions/setup-dotnet@v4
1717
- name: Build nuget with latest version
18-
run: ./scripts/pack-nuget.bash "examples/nuget-packages"
18+
run: |
19+
./scripts/pack-nuget.bash
20+
cp *.nupkg examples/nuget-packages
1921
- name: Build examples with new nuget
2022
run: dotnet build --warnaserror "examples/examples.sln"
23+
- name: Run documentation code snippets
24+
run: |
25+
chmod +x scripts/*
26+
./scripts/run_snippets.sh

snippets/ManualFetchToken.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ public static async Task Main(string[] args)
1515
var clientId = "Client Id from https://dashboard.aspose.cloud/applications";
1616
var clientSecret = "Client Secret from https://dashboard.aspose.cloud/applications";
1717

18+
//Check the clientId is changed to not break github ci pipeline
19+
if(clientId.StartsWith("Client Id"))
20+
{
21+
Console.WriteLine("Client Id not changed. Skip this snippet test.");
22+
return;
23+
24+
}
1825
using var client = new HttpClient
1926
{
2027
BaseAddress = new Uri("https://id.aspose.cloud/")

0 commit comments

Comments
 (0)