Add RBAC role assignment support for resource group security #138
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| paths: | |
| - src/** | |
| - reports/** | |
| pull_request: | |
| types: | |
| - ready_for_review | |
| paths: | |
| - src/** | |
| - reports/** | |
| workflow_dispatch: | |
| inputs: | |
| force_run: | |
| default: false | |
| required: false | |
| type: boolean | |
| description: Bypass code changed check | |
| env: | |
| Solution_Directory: src\AnalyticsEngine\Tests.UnitTests | |
| Build_Platform: anycpu | |
| Build_ProcessorArchitecture: x86 | |
| ClientID: ${{ secrets.APP_CLIENTID }} | |
| ClientSecret: ${{ secrets.APP_CLIENTSECRET }} | |
| TenantGUID: ${{ secrets.APP_TENANTGUID }} | |
| TenantDomain: ${{ secrets.APP_TENANTDOMAIN }} | |
| CognitiveEndpoint: ${{ secrets.APP_COGNITIVEENDPOINT }} | |
| CognitiveKey: ${{ secrets.APP_COGNITIVEKEY}} | |
| CosmosDbTestContainerCurrent: stats | |
| CosmosDbTestContainerHistory: history | |
| CosmosDbTestDatabaseName: UnitTestDevOps | |
| CosmosDb: ${{ secrets.APP_COSMOSDB }} | |
| redis: ${{ secrets.CONNECTIONSTRINGS_REDIS }} | |
| ServiceBus: ${{ secrets.CONNECTIONSTRINGS_SERVICEBUS }} | |
| Storage: ${{ secrets.CONNECTIONSTRINGS_STORAGE }} | |
| jobs: | |
| setup_tests: | |
| # Will check that the interesting folders have been updated. | |
| runs-on: ubuntu-latest | |
| outputs: | |
| code_changed: ${{ steps.changes.outputs.code == 'true' }} | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
| - name: Check if the code has been modified so tests must be run | |
| id: changes | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # 3.0.2 | |
| with: | |
| filters: | | |
| code: | |
| - 'src/**' | |
| test_aitracker: | |
| runs-on: ubuntu-latest | |
| needs: setup_tests | |
| if: inputs.force_run || needs.setup_tests.outputs.code_changed == 'true' | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
| - name: Run AI Tracker tests | |
| run: | | |
| cd src/SPO/AITracker/TypeScript | |
| npm ci | |
| npm run test | |
| test_dotnet: | |
| # Tests job | |
| # Preparation: | |
| # - Transform configuration files | |
| # - Restore dependencies | |
| # Build: | |
| # - Build .Net projects | |
| # Test: | |
| # - Run test suite | |
| runs-on: windows-latest | |
| needs: setup_tests | |
| if: inputs.force_run || needs.setup_tests.outputs.code_changed == 'true' | |
| strategy: | |
| matrix: | |
| configuration: [Release] # [Debug, Release] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # 2.0.0 | |
| - name: Cache NuGet Packages | |
| id: nuget-packages | |
| uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3 | |
| if: false | |
| env: | |
| cache-name: nuget-package-cache | |
| with: | |
| path: ~\.nuget\packages | |
| key: ${{ runner.os }}-${{ env.cache-name }} | |
| - name: Config substitution - Unit tests | |
| uses: microsoft/variable-substitution@6287962da9e5b6e68778dc51e840caa03ca84495 # 1.0.0 | |
| with: | |
| files: '${{ env.Solution_Directory }}\App.Release.config' | |
| - name: Restore the application | |
| run: msbuild ${{ env.Solution_Directory }} -t:Restore ` | |
| -p:Configuration=${{ env.Configuration }} ` | |
| -p:Platform=${{ env.Build_Platform }} ` | |
| -p:ProcessorArchitecture=${{ env.Build_ProcessorArchitecture }} | |
| env: | |
| Configuration: ${{ matrix.configuration }} | |
| - name: Build solution | |
| run: msbuild ${{ env.Solution_Directory }} ` | |
| -p:Configuration=${{ env.Configuration }} ` | |
| -p:Platform=${{ env.Build_Platform }} ` | |
| -p:ProcessorArchitecture=${{ env.Build_ProcessorArchitecture }} | |
| env: | |
| Configuration: ${{ matrix.configuration }} | |
| - name: Execute unit tests | |
| uses: jesusfer/vstest-action@f5ec12ddb71f6e151b738fa4740f8fea61e9214b | |
| with: | |
| testAssembly: Tests.UnitTests.dll | |
| searchFolder: ${{ env.Solution_Directory }}\bin\${{ env.Configuration }}\ | |
| runInParallel: true | |
| vstestLocationMethod: location | |
| vstestLocation: C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe | |
| env: | |
| Configuration: ${{ matrix.configuration }} |