11name :Build
22
33on :
4- push :
5- branches :
6- -develop
7- -master
8- -feature/**
9- -release/**
10- -hotfix/**
114pull_request :
125branches :
13- -master
6+ -main
147 -develop
158
9+ env :
10+ JAVA_DISTRIBUTION :' temurin'
11+ JAVA_VERSION :17
12+ NET_VERSION :9.0.303
13+
1614jobs :
1715build :
16+ permissions :
17+ id-token :write
18+ attestations :write
19+ pull-requests :write
20+
1821runs-on :windows-latest
1922
2023steps :
2124 -name :Checkout
22- uses :actions/checkout@v4
25+ uses :actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2326with :
2427fetch-depth :0
2528fetch-tags :true
2629
27- -name :Install .NET8.0.201
28- uses :actions/setup-dotnet@v4
30+ -name :Install .NET${{ env.NET_VERSION }}
31+ uses :actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
2932with :
30- dotnet-version :' 8.0.201 '
33+ dotnet-version :${{ env.NET_VERSION }}
3134
3235 -name :Restore .NET tools
3336run :dotnet tool restore
3437
3538 -name :Install .NET workloads
36- run :dotnet workload install android ios tvos macos maccatalyst
39+ run :|
40+ dotnet --version
41+ dotnet workload install android ios tvos macos maccatalyst --version ${{ env.NET_VERSION }}
3742
38- -name :Setup Java JDK
39- uses :actions/setup-java@v4
43+ -name :Set up JDK
44+ uses :actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
4045with :
41- distribution :' microsoft '
42- java-version :' 17 '
46+ distribution :${{ env.JAVA_DISTRIBUTION }}
47+ java-version :${{ env.JAVA_VERSION }}
4348
4449 -name :Build
45- run :dotnet cake --verbosity=Minimal --artifactsDir="output"
50+ run :dotnet run --project build/Build.csproj -- --verbosity=Minimal --artifactsDir="${{ github.workspace }}\output" --ctrfDir="${{ github.workspace }}\ctrf"
51+
52+ -name :Print ctrf files in output
53+ run :|
54+ echo "ctrf files in output:"
55+ dir ${{ github.workspace }}\ctrf
56+
57+ -name :Publish Test Report
58+ uses :ctrf-io/github-test-reporter@073c73100796cafcbfdc4722c7fa11c29730439e # v1.0.18
59+ with :
60+ report-path :${{ github.workspace }}/ctrf/*.ctrf.json
61+ summary-report :true
62+ github-report :true
63+ pull-request :true
64+ update-comment :true
65+ env :
66+ GITHUB_TOKEN :${{ secrets.GITHUB_TOKEN }}
67+ if :always()
4668
4769 -name :Upload artifacts
48- uses :actions/upload-artifact@v2
70+ uses :actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4971with :
5072name :build-artifacts
51- path :output
73+ path :${{ github.workspace }}\ output