chore(deps) Update dotnet monorepo to v10 #3055
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: test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - 'dev' | |
| - 'alpha' | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 | |
| with: | |
| version: 10.34.5 | |
| - name: setup node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| - name: install node deps | |
| run: pnpm install --ignore-scripts --frozen-lockfile | |
| - name: lint | |
| run: pnpm run lint | |
| frontend_tests: | |
| name: 'frontend tests' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 | |
| with: | |
| version: 10.34.5 | |
| - name: setup node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| - name: install node deps | |
| run: pnpm install --ignore-scripts --frozen-lockfile | |
| - name: test with coverage | |
| run: pnpm run frontend:test:coverage | |
| - name: upload cov | |
| if: always() | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| files: ./frontend/coverage/cobertura-coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: upload test results | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./frontend/coverage/test-report.junit.xml | |
| report-type: test_results | |
| install_test: | |
| name: 'install test' | |
| runs-on: windows-latest | |
| env: | |
| config: 'Release' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@131b410979e0b49e2162c0718030257b22d6dc2c | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 | |
| with: | |
| version: 10.34.5 | |
| - name: setup node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| - name: install node deps | |
| run: pnpm install --ignore-scripts --frozen-lockfile | |
| - name: node build | |
| run: pnpm run build | |
| - name: create settings file | |
| run: | | |
| cd web | |
| echo '{"ConnectionStrings":' > appsettings.cust.json | |
| echo '{"AtlasDatabase":' >> appsettings.cust.json | |
| echo '"Server=(localdb)\\mssqllocaldb;Database=atlas_test;Trusted_Connection=True"' >> appsettings.cust.json | |
| echo "}}" >> appsettings.cust.json | |
| cat appsettings.cust.json | |
| - name: install localdb | |
| uses: potatoqualitee/mssqlsuite@2291d923e83859edd871679c05b379037376761f | |
| with: | |
| install: localdb | |
| - name: setup dotnet ef | |
| run: dotnet tool install --tool-path .\.dotnet-tools dotnet-ef --version 9.0.11 | |
| - name: migrate | |
| run: .\.dotnet-tools\dotnet-ef database update --project web/web.csproj | |
| integration_tests: | |
| name: 'integration tests' | |
| runs-on: windows-latest | |
| env: | |
| config: 'Release' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@131b410979e0b49e2162c0718030257b22d6dc2c | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: setup dotnet ef | |
| run: dotnet tool install --tool-path .\.dotnet-tools dotnet-ef --version 9.0.11 | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 | |
| with: | |
| version: 10.34.5 | |
| - name: setup node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| - name: setup java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 | |
| with: | |
| distribution: 'microsoft' | |
| java-version: '17' | |
| - name: install node deps | |
| run: pnpm install --ignore-scripts --frozen-lockfile | |
| - name: node build | |
| run: pnpm run build | |
| - name: install dotnet deps | |
| run: | | |
| dotnet tool install -g dotnet-reportgenerator-globaltool | |
| dotnet restore | |
| - name: build | |
| run: pnpm run dotnet:build | |
| - name: start solr | |
| run: ./web/solr/bin/solr start | |
| - name: test | |
| run: | | |
| dotnet test web.Tests/web.Tests.csproj --filter IntegrationTests --no-build -e Demo=True --collect:"XPlat Code Coverage;Format=cobertura" --results-directory TestResults --logger:"junit;LogFilePath=TestResults/integration-tests.junit.xml" | |
| env: | |
| BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
| BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | |
| - name: collect coverage file | |
| if: always() | |
| shell: pwsh | |
| run: | | |
| $coverageFile = Get-ChildItem -Path TestResults -Recurse -Filter coverage.cobertura.xml | | |
| Sort-Object LastWriteTimeUtc -Descending | | |
| Select-Object -First 1 | |
| if ($coverageFile) { | |
| Copy-Item $coverageFile.FullName coverage.cobertura.xml -Force | |
| Write-Host "Copied coverage file from $($coverageFile.FullName)" | |
| } else { | |
| Write-Host "Coverage file not found under TestResults" | |
| } | |
| - name: console coverage | |
| if: always() | |
| run: | | |
| # generate a report just to show in the action history | |
| if (Test-Path coverage.cobertura.xml) { | |
| reportgenerator -reports:coverage.cobertura.xml -targetdir:coverage/ -reporttypes:textSummary | |
| # print out the report | |
| cat coverage/Summary.txt | |
| } else { | |
| Write-Host "Coverage file not found, skipping report generation" | |
| } | |
| - name: enforce coverage threshold | |
| if: always() | |
| shell: pwsh | |
| env: | |
| COVERAGE_THRESHOLD: '1' | |
| run: | | |
| if (!(Test-Path coverage.cobertura.xml)) { | |
| Write-Host "Coverage file not found, skipping threshold check." | |
| exit 0 | |
| } | |
| [xml]$coverage = Get-Content coverage.cobertura.xml | |
| $lineRate = [double]$coverage.coverage.'line-rate' * 100 | |
| Write-Host ("Line coverage: {0:N2}%" -f $lineRate) | |
| if ($lineRate -lt [double]$env:COVERAGE_THRESHOLD) { | |
| throw "Line coverage $lineRate is below threshold $env:COVERAGE_THRESHOLD." | |
| } | |
| - name: upload cov | |
| if: always() | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| files: ./coverage.cobertura.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: upload test results | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./TestResults/integration-tests.junit.xml | |
| report-type: test_results | |
| flags: integration | |
| # browser_tests: | |
| # name: 'browser tests' | |
| # runs-on: windows-latest | |
| # env: | |
| # config: 'Release' | |
| # steps: | |
| # - name: checkout | |
| # uses: actions/checkout@v3 | |
| # - name: setup dotnet | |
| # uses: actions/setup-dotnet@v3 | |
| # with: | |
| # dotnet-version: '7.0.x' | |
| # - name: setup node | |
| # uses: actions/setup-node@v3 | |
| # with: | |
| # node-version: '18.x' | |
| # - name: setup java | |
| # uses: actions/setup-java@v3 | |
| # with: | |
| # distribution: 'microsoft' | |
| # java-version: '17' | |
| # - name: install node deps | |
| # run: npm install | |
| # - name: node build | |
| # run: npm run build | |
| # - name: install dotnet deps | |
| # run: | | |
| # dotnet tool install -g coverlet.console | |
| # dotnet tool install -g dotnet-reportgenerator-globaltool | |
| # dotnet restore | |
| # - name: build | |
| # run: npm run dotnet:build | |
| # - name: start solr | |
| # run: ./web/solr/bin/solr start | |
| # - name: test | |
| # run: | | |
| # npm run test:browserTests | |
| # env: | |
| # BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
| # BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | |
| # - name: console coverage | |
| # if: always() | |
| # run: | | |
| # # generate a report just to show in the action history | |
| # reportgenerator -reports:coverage.cobertura.xml -targetdir:coverage/ -reporttypes:textSummary | |
| # # print out the report | |
| # cat coverage/Summary.txt | |
| # - name: upload cov | |
| # if: always() | |
| # uses: codecov/codecov-action@v3 | |
| # with: | |
| # files: ./coverage.cobertura.xml | |
| # verbose: true | |
| function_tests: | |
| name: 'function tests' | |
| runs-on: windows-latest | |
| env: | |
| config: 'Release' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@131b410979e0b49e2162c0718030257b22d6dc2c | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 | |
| with: | |
| version: 10.34.5 | |
| - name: setup node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| - name: setup java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 | |
| with: | |
| distribution: 'microsoft' | |
| java-version: '17' | |
| - name: install node deps | |
| run: pnpm install --ignore-scripts --frozen-lockfile | |
| - name: node build | |
| run: pnpm run build | |
| - name: install dotnet deps | |
| run: | | |
| dotnet tool install -g dotnet-reportgenerator-globaltool | |
| dotnet restore | |
| - name: build | |
| run: pnpm run dotnet:build | |
| - name: start solr | |
| run: ./web/solr/bin/solr start | |
| - name: test | |
| run: | | |
| dotnet test web.Tests/web.Tests.csproj --filter FunctionTests --no-build -e Demo=True --collect:"XPlat Code Coverage;Format=cobertura" --results-directory TestResults --logger:"junit;LogFilePath=TestResults/function-tests.junit.xml" | |
| env: | |
| VSTEST_CONNECTION_TIMEOUT: 300 | |
| BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
| BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | |
| - name: collect coverage file | |
| if: always() | |
| shell: pwsh | |
| run: | | |
| $coverageFile = Get-ChildItem -Path TestResults -Recurse -Filter coverage.cobertura.xml | | |
| Sort-Object LastWriteTimeUtc -Descending | | |
| Select-Object -First 1 | |
| if ($coverageFile) { | |
| Copy-Item $coverageFile.FullName coverage.cobertura.xml -Force | |
| Write-Host "Copied coverage file from $($coverageFile.FullName)" | |
| } else { | |
| Write-Host "Coverage file not found under TestResults" | |
| } | |
| - name: console coverage | |
| if: always() | |
| run: | | |
| # generate a report just to show in the action history | |
| if (Test-Path coverage.cobertura.xml) { | |
| reportgenerator -reports:coverage.cobertura.xml -targetdir:coverage/ -reporttypes:textSummary | |
| # print out the report | |
| cat coverage/Summary.txt | |
| } else { | |
| Write-Host "Coverage file not found, skipping report generation" | |
| } | |
| - name: enforce coverage threshold | |
| if: always() | |
| shell: pwsh | |
| env: | |
| COVERAGE_THRESHOLD: '1' | |
| run: | | |
| if (!(Test-Path coverage.cobertura.xml)) { | |
| Write-Host "Coverage file not found, skipping threshold check." | |
| exit 0 | |
| } | |
| [xml]$coverage = Get-Content coverage.cobertura.xml | |
| $lineRate = [double]$coverage.coverage.'line-rate' * 100 | |
| Write-Host ("Line coverage: {0:N2}%" -f $lineRate) | |
| if ($lineRate -lt [double]$env:COVERAGE_THRESHOLD) { | |
| throw "Line coverage $lineRate is below threshold $env:COVERAGE_THRESHOLD." | |
| } | |
| - name: upload cov | |
| if: always() | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| files: ./coverage.cobertura.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: upload test results | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./TestResults/function-tests.junit.xml | |
| report-type: test_results | |
| flags: function |