Merge pull request #130 from magiccodingman/fix/reliable-release-pack… #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Core validation | |
| on: | |
| workflow_call: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: core-validation-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| jobs: | |
| core-validation: | |
| name: Core validation | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - name: Set up .NET 10 | |
| uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore unit tests | |
| run: dotnet restore Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj | |
| - name: Test package version calculation | |
| run: bash .github/scripts/test-calculate-package-version.sh | |
| - name: Pack the NuGet artifact from a clean build state | |
| run: bash .github/scripts/pack-nuget.sh artifacts/package | |
| - name: Verify package contents | |
| shell: bash | |
| run: | | |
| package="$(find artifacts/package -maxdepth 1 -name '*.nupkg' -print -quit)" | |
| test -n "${package}" | |
| unzip -Z1 "${package}" | grep -Fx README.md | |
| unzip -Z1 "${package}" | grep -Fx LICENSE.txt | |
| unzip -Z1 "${package}" | grep -Fx wizardHatIcon.png | |
| unzip -Z1 "${package}" | grep -F 'staticwebassets/' | |
| - name: Run unit and contract tests | |
| run: >- | |
| dotnet test Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj | |
| --configuration Release | |
| --no-restore | |
| --logger "trx;LogFileName=core-validation.trx" | |
| --results-directory artifacts/test-results | |
| - name: Upload test results and package | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: core-validation-${{ github.run_attempt }} | |
| path: | | |
| artifacts/test-results/*.trx | |
| artifacts/package/*.nupkg | |
| if-no-files-found: warn | |
| overwrite: true |