Merge pull request #3 from EFNext/feat/consolidated-generated-classes #37
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDKs | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.x | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }} | |
| restore-keys: | | |
| nuget-${{ runner.os }}- | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore -c Release | |
| - name: Test | |
| run: >- | |
| dotnet test --no-build -c Release | |
| -- | |
| --report-trx --report-trx-filename results.trx | |
| --results-directory ./test-results | |
| --coverage | |
| --coverage-output-format cobertura | |
| --coverage-output coverage.xml | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| ./test-results/**/*.trx | |
| ./test-results/**/coverage.xml | |
| retention-days: 14 | |
| - name: Test report | |
| if: always() | |
| uses: dorny/test-reporter@v1 | |
| with: | |
| name: Test Results | |
| path: ./test-results/**/*.trx | |
| reporter: dotnet-trx | |
| - name: Pack | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: >- | |
| dotnet pack --no-build -c Release | |
| -p:VersionSuffix=ci.${{ github.run_number }} | |
| --output ./packages | |
| - name: Upload NuGet packages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: | | |
| ./packages/*.nupkg | |
| ./packages/*.snupkg | |
| retention-days: 14 |