ci: split PR checks into explicit job groups #73
Workflow file for this run
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: PR Check | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: build (${{ matrix.configuration }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| configuration: [ Debug, Release ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore ModularityKit.Mutator.slnx | |
| - name: Build ${{ matrix.configuration }} | |
| run: dotnet build ModularityKit.Mutator.slnx -c ${{ matrix.configuration }} --no-restore | |
| validate: | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: test:core | |
| command: dotnet test Tests/ModularityKit.Mutator.Tests/ModularityKit.Mutator.Tests.csproj -c Release --no-restore | |
| redis: false | |
| - name: test:governance | |
| command: dotnet test Tests/ModularityKit.Mutator.Governance.Tests/ModularityKit.Mutator.Governance.Tests.csproj -c Release --no-restore | |
| redis: false | |
| - name: test:governance-redis | |
| command: dotnet test Tests/ModularityKit.Mutator.Governance.Redis.Tests/ModularityKit.Mutator.Governance.Redis.Tests.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:core / BillingQuotas | |
| command: dotnet run --project Examples/Core/BillingQuotas/BillingQuotas.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:core / FeatureFlags | |
| command: dotnet run --project Examples/Core/FeatureFlags/FeatureFlags.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:core / IamRoles | |
| command: dotnet run --project Examples/Core/IamRoles/IamRoles.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:core / WorkflowApprovals | |
| command: dotnet run --project Examples/Core/WorkflowApprovals/WorkflowApprovals.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / RequestLifecycle | |
| command: dotnet run --project Examples/Governance/RequestLifecycle/RequestLifecycle.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / GovernedExecution | |
| command: dotnet run --project Examples/Governance/GovernedExecution/GovernedExecution.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / DecisionTaxonomy | |
| command: dotnet run --project Examples/Governance/DecisionTaxonomy/DecisionTaxonomy.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / ApprovalWorkflow | |
| command: dotnet run --project Examples/Governance/ApprovalWorkflow/ApprovalWorkflow.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / VersionedResolution | |
| command: dotnet run --project Examples/Governance/VersionedResolution/VersionedResolution.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / Queries | |
| command: dotnet run --project Examples/Governance/Queries/Queries.csproj -c Release --no-restore | |
| redis: false | |
| - name: examples:governance / RedisQueries | |
| command: dotnet run --project Examples/Governance/RedisQueries/RedisQueries.csproj -c Release --no-restore | |
| redis: true | |
| redis_workdir: Examples/Governance/RedisQueries | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore ModularityKit.Mutator.slnx | |
| - name: Run ${{ matrix.name }} | |
| if: ${{ !matrix.redis }} | |
| run: ${{ matrix.command }} | |
| - name: Start Redis | |
| if: ${{ matrix.redis }} | |
| working-directory: ${{ matrix.redis_workdir }} | |
| run: docker compose up -d | |
| - name: Run RedisQueries | |
| if: ${{ matrix.redis }} | |
| env: | |
| MODULARITYKIT_REDIS: localhost:6379 | |
| run: ${{ matrix.command }} | |
| - name: Stop Redis | |
| if: ${{ always() && matrix.redis }} | |
| working-directory: ${{ matrix.redis_workdir }} | |
| run: docker compose down | |
| validation-summary: | |
| name: validation summary | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - validate | |
| if: always() | |
| steps: | |
| - name: Report job results | |
| run: | | |
| echo "build: ${{ needs.build.result }}" | |
| echo "validate: ${{ needs.validate.result }}" | |
| if [ "${{ needs.build.result }}" != "success" ] || \ | |
| [ "${{ needs.validate.result }}" != "success" ]; then | |
| exit 1 | |
| fi |