fix: daily CI OOM build TFMs sequentially (#1127) #1165
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: Validate Pull Request | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ 'feature/*', 'main' ] | |
| pull_request: | |
| branches: [ 'feature/*', 'main' ] | |
| permissions: | |
| contents: read #those permissions are required to run the codeql analysis | |
| actions: read | |
| security-events: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| solutionName: Microsoft.Graph.Beta.sln | |
| projectName: src/Microsoft.Graph/Microsoft.Graph.Beta.csproj | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5.3.0 | |
| with: | |
| dotnet-version: | | |
| 8.x | |
| 10.x | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.solutionName }} | |
| # Build each TFM sequentially to avoid OOM kills on the runner. | |
| # Building all TFMs in parallel exhausts memory on standard GitHub Actions runners (exit code 137). | |
| - name: Build for netstandard2.0 | |
| run: dotnet build ${{ env.projectName }} -f netstandard2.0 --no-restore -c Release | |
| - name: Build for netstandard2.1 | |
| run: dotnet build ${{ env.projectName }} -f netstandard2.1 --no-restore -c Release | |
| - name: Build for net8.0 | |
| run: dotnet build ${{ env.projectName }} -f net8.0 --no-restore -c Release | |
| - name: Build for net10.0 | |
| run: dotnet build ${{ env.projectName }} -f net10.0 --no-restore -c Release | |
| - name: Build test project | |
| run: dotnet build ${{ env.solutionName }} --no-restore -c Release | |
| - name: Test | |
| run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover | |
| analyze: | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| env: | |
| solutionName: Microsoft.Graph.Beta.sln | |
| projectName: src/Microsoft.Graph/Microsoft.Graph.Beta.csproj | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [ 'csharp' ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: ${{ matrix.language }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5.3.0 | |
| with: | |
| dotnet-version: | | |
| 8.x | |
| 10.x | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.solutionName }} | |
| - name: Build for netstandard2.0 | |
| run: dotnet build ${{ env.projectName }} -f netstandard2.0 --no-restore -c Release --no-incremental | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 |