chore(ci): add per-workflow aggregators and iOS test workflow #274
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: Test .NET Frameworks | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "samples/dotnet/**" | |
| - ".github/workflows/test-dotnet.yml" | |
| pull_request: | |
| paths: | |
| - "samples/dotnet/**" | |
| - ".github/workflows/test-dotnet.yml" | |
| schedule: | |
| - cron: "0 8 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| find-projects: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.find.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: find | |
| run: | | |
| DIRS=$(find samples -name "*.sln" -not -path "*/node_modules/*" -exec dirname {} \; 2>/dev/null | sort | jq -R -s -c 'split("\n") | map(select(. != ""))') | |
| echo "matrix=$DIRS" >> "$GITHUB_OUTPUT" | |
| test: | |
| needs: find-projects | |
| if: ${{ needs.find-projects.outputs.matrix != '[]' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: ${{ fromJson(needs.find-projects.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Restore | |
| working-directory: ${{ matrix.project }} | |
| run: dotnet restore | |
| - name: Build | |
| working-directory: ${{ matrix.project }} | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Test | |
| working-directory: ${{ matrix.project }} | |
| run: dotnet test --no-build --configuration Release | |
| # Stable aggregator for branch protection. | |
| all-tests-passed: | |
| name: .NET tests passed | |
| needs: test | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify test matrix succeeded | |
| if: needs.test.result != 'success' && needs.test.result != 'skipped' | |
| run: exit 1 |