[DMS-867] Perf fixes into main #61
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
| # SPDX-License-Identifier: Apache-2.0 | |
| # Licensed to the Ed-Fi Alliance under one or more agreements. | |
| # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. | |
| # See the LICENSE and NOTICES files in the project root for more information. | |
| name: On DMS DDL Schema Generator Pull Request | |
| on: | |
| push: | |
| # Running on push to main to support CodeQL on C# | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CONFIGURATION: "Release" | |
| permissions: read-all | |
| jobs: | |
| scan-actions-bidi: | |
| name: Scan Actions, scan all files for BIDI Trojan Attacks | |
| uses: Ed-Fi-Alliance-OSS/Ed-Fi-Actions/.github/workflows/repository-scanner.yml@main | |
| with: | |
| config-file-path: ./.github/workflows/bidi-config.json | |
| run-unit-tests: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write | |
| defaults: | |
| run: | |
| shell: pwsh | |
| steps: | |
| - name: Checkout the Repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Cache Nuget packages | |
| uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Build | |
| run: ./build-cli-generator.ps1 Build -Configuration ${{ env.CONFIGURATION }} | |
| - name: Install Coverlet Reference | |
| if: success() | |
| run: | | |
| dotnet tool install --global coverlet.console | |
| dotnet tool install --global dotnet-reportgenerator-globaltool | |
| - name: Run Unit Tests | |
| run: ./build-cli-generator.ps1 UnitTest -Configuration ${{ env.CONFIGURATION }} | |
| - name: Generate Coverage Report | |
| if: ${{ hashFiles('coverage.cobertura.xml') != '' }} | |
| run: ./build-cli-generator.ps1 Coverage | |
| - name: Upload Coverage Report | |
| if: always() | |
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5 | |
| with: | |
| name: Coverage Report | |
| path: coveragereport | |
| - name: Upload Test Results | |
| uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1 | |
| if: (success() || failure()) | |
| with: | |
| name: Unit Tests | |
| path: "**/*.trx" | |
| path-replace-backslashes: "true" | |
| reporter: dotnet-trx | |
| event_file: | |
| name: Upload Event File | |
| runs-on: ubuntu-latest | |
| needs: | |
| [ | |
| run-unit-tests | |
| ] | |
| if: always() | |
| steps: | |
| - name: Upload | |
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5 | |
| with: | |
| name: Event File | |
| path: ${{ github.event_path }} |