|
| 1 | +# This was generated by tool. Edits will be overwritten. |
| 2 | + |
| 3 | +name: razor-slices/ci |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + push: |
| 7 | + paths: |
| 8 | + - .github/workflows/razor-slices-** |
| 9 | + - razor-slices/** |
| 10 | + - .editorconfig |
| 11 | + - Directory.Packages.props |
| 12 | + - global.json |
| 13 | + - src.props |
| 14 | + - test.props |
| 15 | + pull_request: |
| 16 | + paths: |
| 17 | + - .github/workflows/razor-slices-** |
| 18 | + - razor-slices/** |
| 19 | + - .editorconfig |
| 20 | + - Directory.Packages.props |
| 21 | + - global.json |
| 22 | + - src.props |
| 23 | + - test.props |
| 24 | +env: |
| 25 | + DOTNET_NOLOGO: true |
| 26 | + DOTNET_CLI_TELEMETRY_OPTOUT: true |
| 27 | +jobs: |
| 28 | + build: |
| 29 | + name: Build |
| 30 | + runs-on: ubuntu-latest |
| 31 | + permissions: |
| 32 | + actions: read |
| 33 | + checks: write |
| 34 | + contents: read |
| 35 | + packages: write |
| 36 | + defaults: |
| 37 | + run: |
| 38 | + shell: bash |
| 39 | + working-directory: razor-slices |
| 40 | + timeout-minutes: 15 |
| 41 | + steps: |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| 44 | + with: |
| 45 | + fetch-depth: 0 |
| 46 | + - name: Setup Dotnet |
| 47 | + uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d |
| 48 | + with: |
| 49 | + dotnet-version: 10.0.100 |
| 50 | + - name: Restore |
| 51 | + run: dotnet restore *.slnf |
| 52 | + - name: Verify Formatting |
| 53 | + run: dotnet format *.slnf --verify-no-changes --no-restore |
| 54 | + - name: Build - RazorSlices.Tests |
| 55 | + run: dotnet build -c Release test/RazorSlices.Tests |
| 56 | + - name: Test - RazorSlices.Tests |
| 57 | + run: >- |
| 58 | + for tfm in net10.0; do |
| 59 | + dotnet run --project test/RazorSlices.Tests -c Release --no-build -f $tfm -- \ |
| 60 | + --report-xunit-trx --report-xunit-trx-filename RazorSlices.Tests-$tfm.trx \ |
| 61 | + --coverage --coverage-output-format cobertura \ |
| 62 | + --coverage-output RazorSlices.Tests-$tfm.cobertura.xml |
| 63 | + done |
| 64 | + - name: Build - SourceGenerator.Tests |
| 65 | + run: dotnet build -c Release test/SourceGenerator.Tests |
| 66 | + - name: Test - SourceGenerator.Tests |
| 67 | + run: >- |
| 68 | + for tfm in net10.0; do |
| 69 | + dotnet run --project test/SourceGenerator.Tests -c Release --no-build -f $tfm -- \ |
| 70 | + --report-xunit-trx --report-xunit-trx-filename SourceGenerator.Tests-$tfm.trx \ |
| 71 | + --coverage --coverage-output-format cobertura \ |
| 72 | + --coverage-output SourceGenerator.Tests-$tfm.cobertura.xml |
| 73 | + done |
| 74 | + - name: Test report |
| 75 | + if: success() || failure() |
| 76 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 |
| 77 | + with: |
| 78 | + name: test-results |
| 79 | + path: |- |
| 80 | + razor-slices/test/RazorSlices.Tests/TestResults/RazorSlices.Tests-net10.0.trx |
| 81 | + razor-slices/test/SourceGenerator.Tests/TestResults/SourceGenerator.Tests-net10.0.trx |
| 82 | + retention-days: 5 |
| 83 | + - name: Tool restore |
| 84 | + run: dotnet tool restore |
| 85 | + - name: Pack RazorSlices |
| 86 | + run: dotnet pack -c Release src/RazorSlices -o artifacts |
| 87 | + - name: Sign packages |
| 88 | + if: github.event_name == 'push' |
| 89 | + run: |- |
| 90 | + for file in artifacts/*.nupkg; do |
| 91 | + dotnet NuGetKeyVaultSignTool sign "$file" --file-digest sha256 --timestamp-rfc3161 http://timestamp.digicert.com --azure-key-vault-url https://duendecodesigninghsm.vault.azure.net/ --azure-key-vault-client-id 18e3de68-2556-4345-8076-a46fad79e474 --azure-key-vault-tenant-id ed3089f0-5401-4758-90eb-066124e2d907 --azure-key-vault-client-secret ${{ secrets.SignClientSecret }} --azure-key-vault-certificate NuGetPackageSigning |
| 92 | + done |
| 93 | + - name: Push packages to GitHub |
| 94 | + if: github.ref == 'refs/heads/main' |
| 95 | + run: dotnet nuget push artifacts/*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |
| 96 | + env: |
| 97 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + - name: Upload Artifacts |
| 100 | + if: github.event_name == 'push' |
| 101 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 |
| 102 | + with: |
| 103 | + name: artifacts |
| 104 | + path: razor-slices/artifacts/*.nupkg |
| 105 | + overwrite: true |
| 106 | + retention-days: 15 |
0 commit comments