|
24 | 24 | jobs: |
25 | 25 | build: |
26 | 26 | name: Build and Test |
27 | | - runs-on: ubuntu-24.04 |
| 27 | + runs-on: ubuntu-latest |
28 | 28 | steps: |
29 | | - - name: 'Harden Runner' |
30 | | - uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 |
31 | | - with: |
32 | | - egress-policy: audit |
33 | | - |
34 | | - - name: 'Checkout' |
35 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
36 | | - with: |
37 | | - fetch-depth: 0 # avoid shallow clone so nbgv can do its work. |
38 | | - |
39 | | - - name: 'Setup .NET SDK' |
40 | | - uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0 |
41 | | - with: |
42 | | - dotnet-version: 10.0.x |
43 | | - |
44 | | - - name: 'Restore external dependencies' |
45 | | - run: dotnet restore |
46 | | - |
47 | | - - name: 'Build' |
48 | | - id: build |
49 | | - run: dotnet build --configuration Debug --no-restore |
50 | | - |
51 | | - - name: Upload Build Artifacts |
52 | | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
53 | | - with: |
54 | | - name: build-artifacts |
55 | | - path: | |
56 | | - src/**/BCrypt.*.nupkg |
57 | | - retention-days: 5 |
58 | | - |
59 | | - - name: 'Test' |
60 | | - id: test |
61 | | - run: dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github --project tests/UnitTests/BCrypt.Net.UnitTests.csproj |
62 | | - |
63 | | - - name: 'Create test summary' |
64 | | - uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 |
65 | | - with: |
66 | | - paths: tests/UnitTests/**/TestResults.xml |
67 | | - show: "fail, skip" |
68 | | - if: always() |
69 | | - |
70 | | - - name: 'Generate Coverage Reports' |
71 | | - uses: danielpalme/ReportGenerator-GitHub-Action@c4c5175a441c6603ec614f5084386dabe0e2295b # v5.4.12 |
72 | | - with: |
73 | | - reports: "tests/**/*.cobertura.xml" |
74 | | - targetdir: "${{ github.workspace }}" |
75 | | - reporttypes: "Cobertura" |
76 | | - verbosity: "Info" |
77 | | - title: "Code Coverage" |
78 | | - tag: "${{ github.run_number }}_${{ github.run_id }}" |
79 | | - toolpath: "reportgeneratortool" |
80 | | - license: ${{ secrets.REPORT_GENERATOR_LICENSE }} |
81 | | - |
82 | | - - name: Publish Code Coverage Report |
83 | | - uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 |
84 | | - with: |
85 | | - filename: "Cobertura.xml" |
86 | | - badge: true |
87 | | - fail_below_min: false # just informative for now |
88 | | - format: markdown |
89 | | - hide_branch_rate: false |
90 | | - hide_complexity: false |
91 | | - indicators: true |
92 | | - output: both |
93 | | - thresholds: "10 30" |
94 | | - |
95 | | - - name: Upload Code Coverage Results |
96 | | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
97 | | - with: |
98 | | - name: coverage-results |
99 | | - path: | |
100 | | - ${{ github.workspace }}/Cobertura.xml |
101 | | - ${{ github.workspace }}/code-coverage-results.md |
102 | | - retention-days: 5 |
103 | | - |
104 | | - - name: Publish Test Results |
105 | | - uses: EnricoMi/publish-unit-test-result-action@afb2984f4d89672b2f9d9c13ae23d53779671984 # v2.19.0 |
106 | | - if: always() |
107 | | - with: |
108 | | - files: "tests/**/TestResults.xml" |
109 | | - |
110 | | - - name: Upload Test Artifacts |
111 | | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
112 | | - with: |
113 | | - name: test-results |
114 | | - path: "tests/**/TestResults.xml" |
115 | | - retention-days: 5 |
| 29 | + - name: Harden the runner |
| 30 | + uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3 |
| 31 | + with: |
| 32 | + egress-policy: audit |
| 33 | + |
| 34 | + - name: 'Checkout' |
| 35 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 36 | + with: |
| 37 | + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. |
| 38 | + |
| 39 | + - name: 'Setup .NET SDK' |
| 40 | + uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 |
| 41 | + with: |
| 42 | + dotnet-version: 10.x |
| 43 | + |
| 44 | + - name: 'Restore external dependencies' |
| 45 | + run: dotnet restore |
| 46 | + |
| 47 | + - name: 'Build' |
| 48 | + id: build |
| 49 | + run: dotnet build --configuration Debug --no-restore |
| 50 | + |
| 51 | + - name: Upload Build Artifacts |
| 52 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 53 | + with: |
| 54 | + name: build-artifacts |
| 55 | + path: | |
| 56 | + src/**/BCrypt.*.nupkg |
| 57 | + retention-days: 5 |
| 58 | + |
| 59 | + - name: 'Test' |
| 60 | + id: test |
| 61 | + run: dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github --project tests/UnitTests/BCrypt.Net.UnitTests.csproj |
| 62 | + |
| 63 | + - name: 'Create test summary' |
| 64 | + uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2.6 |
| 65 | + with: |
| 66 | + paths: tests/UnitTests/**/TestResults.xml |
| 67 | + show: "fail, skip" |
| 68 | + if: always() |
| 69 | + |
| 70 | + - name: 'Generate Coverage Reports' |
| 71 | + uses: danielpalme/ReportGenerator-GitHub-Action@049f7ec958c672fd31d5cc1cb01622dc8d2e23ab # 5.5.10 |
| 72 | + with: |
| 73 | + reports: "tests/**/*.cobertura.xml" |
| 74 | + targetdir: "${{ github.workspace }}" |
| 75 | + reporttypes: "Cobertura" |
| 76 | + verbosity: "Info" |
| 77 | + title: "Code Coverage" |
| 78 | + tag: "${{ github.run_number }}_${{ github.run_id }}" |
| 79 | + toolpath: "reportgeneratortool" |
| 80 | + license: ${{ secrets.REPORT_GENERATOR_LICENSE }} |
| 81 | + |
| 82 | + - name: Publish Code Coverage Report |
| 83 | + uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 |
| 84 | + with: |
| 85 | + filename: "Cobertura.xml" |
| 86 | + badge: true |
| 87 | + fail_below_min: false # just informative for now |
| 88 | + format: markdown |
| 89 | + hide_branch_rate: false |
| 90 | + hide_complexity: false |
| 91 | + indicators: true |
| 92 | + output: both |
| 93 | + thresholds: "10 30" |
| 94 | + |
| 95 | + - name: Upload Code Coverage Results |
| 96 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 97 | + with: |
| 98 | + name: coverage-results |
| 99 | + path: | |
| 100 | + ${{ github.workspace }}/Cobertura.xml |
| 101 | + ${{ github.workspace }}/code-coverage-results.md |
| 102 | + retention-days: 5 |
| 103 | + |
| 104 | + - name: Publish Test Results |
| 105 | + uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0 |
| 106 | + if: always() |
| 107 | + with: |
| 108 | + files: "tests/**/TestResults.xml" |
| 109 | + |
| 110 | + - name: Upload Test Artifacts |
| 111 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 112 | + with: |
| 113 | + name: test-results |
| 114 | + path: "tests/**/TestResults.xml" |
| 115 | + retention-days: 5 |
0 commit comments