1 | | - | version: 33 |
2 | | - | jobs: |
3 | | - | - name: dotnet ci |
4 | | - | steps: |
5 | | - | - !CheckoutStep |
6 | | - | name: checkout code |
7 | | - | cloneCredential: !DefaultCredential {} |
8 | | - | withLfs: false |
9 | | - | withSubmodules: false |
10 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
11 | | - | - !GenerateChecksumStep |
12 | | - | name: generate project checksum |
13 | | - | files: '**/*.csproj' |
14 | | - | targetFile: checksum |
15 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
16 | | - | - !SetupCacheStep |
17 | | - | name: set up nuget cache |
18 | | - | key: nuget_packages_@file:checksum@ |
19 | | - | loadKeys: |
20 | | - | - nuget_packages |
21 | | - | paths: |
22 | | - | - /root/.nuget/packages |
23 | | - | uploadStrategy: UPLOAD_IF_NOT_HIT |
24 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
25 | | - | - !CommandStep |
26 | | - | name: run tests |
27 | | - | runInContainer: true |
28 | | - | image: mcr.microsoft.com/dotnet/sdk |
29 | | - | interpreter: !DefaultInterpreter |
30 | | - | commands: | |
31 | | - | dotnet tool install -g roslynator.dotnet.cli |
32 | | - | dotnet test -l trx --collect:"XPlat Code Coverage" |
33 | | - | /root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml |
34 | | - | useTTY: true |
35 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
36 | | - | - !PublishTRXReportStep |
37 | | - | name: publish unit test report |
38 | | - | reportName: Unit Test |
39 | | - | filePatterns: '**/*.trx' |
40 | | - | condition: ALWAYS |
41 | | - | - !PublishCoberturaReportStep |
42 | | - | name: publish code coverage report |
43 | | - | reportName: Code Coverage |
44 | | - | filePatterns: '**/coverage.cobertura.xml' |
45 | | - | condition: ALWAYS |
46 | | - | - !PublishRoslynatorReportStep |
47 | | - | name: publish code problem report |
48 | | - | reportName: Code Problems |
49 | | - | filePatterns: roslynator-analysis.xml |
50 | | - | failThreshold: HIGH |
51 | | - | condition: ALWAYS |
52 | | - | triggers: |
53 | | - | - !BranchUpdateTrigger {} |
54 | | - | - !PullRequestUpdateTrigger {} |
55 | | - | retryCondition: never |
56 | | - | maxRetries: 3 |
57 | | - | retryDelay: 30 |
58 | | - | timeout: 3600 |
59 | | - | - name: New build |
60 | | - | steps: |
61 | | - | - !CheckoutStep |
62 | | - | name: Checkout |
63 | | - | cloneCredential: !DefaultCredential {} |
64 | | - | withLfs: false |
65 | | - | withSubmodules: false |
66 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
67 | | - | - !SetBuildVersionStep |
68 | | - | name: Next build version |
69 | | - | buildVersion: 0.4.3 |
70 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
71 | | - | - !CommandStep |
72 | | - | name: Build application |
73 | | - | runInContainer: false |
74 | | - | interpreter: !ShellInterpreter |
75 | | - | shell: bash |
76 | | - | commands: | |
77 | | - | dotnet build |
78 | | - | useTTY: true |
79 | | - | condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL |
80 | | - | retryCondition: never |
81 | | - | maxRetries: 3 |
82 | | - | retryDelay: 30 |
83 | | - | timeout: 3600 |
84 | | - | |