refactor(abstractions): rename ILambdaHostContext to ILambdaInvocationContext #335
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: PR Build | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: [ "main" ] | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - '.github/workflows/docs.yaml' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '**.md' | |
| concurrency: | |
| group: pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Act Workaround # https://github.com/nektos/act/issues/973 | |
| if: ${{ env.ACT }} | |
| run: curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Install dotnet tools | |
| run: dotnet tool restore | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| - name: Run formatting | |
| run: task format:csharpier | |
| - name: Check for formatting changes | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "❌ Code formatting issues detected!" | |
| echo "The following files need formatting:" | |
| git status --porcelain | |
| echo "" | |
| echo "Run the following commands locally to fix:" | |
| echo " task format:all" | |
| exit 1 | |
| else | |
| echo "✅ All code is properly formatted!" | |
| fi | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: 'zulu' | |
| - name: Cache SonarQube packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache SonarQube scanner | |
| id: cache-sonar-scanner | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.sonar/scanner | |
| key: ${{ runner.os }}-sonar-scanner | |
| restore-keys: ${{ runner.os }}-sonar-scanner | |
| - name: Install SonarQube scanner | |
| if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p ~/.sonar/scanner | |
| dotnet tool update dotnet-sonarscanner --tool-path ~/.sonar/scanner | |
| - name: Start SonarQube | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| ~/.sonar/scanner/dotnet-sonarscanner begin \ | |
| /k:"j-d-ha_minimal-lambda" \ | |
| /o:"j-d-ha" \ | |
| /d:sonar.exclusions="**/bin/**,**/obj/**,tests/MinimalLambda.SourceGenerators.UnitTests/Snapshots/**,**/coverage/**,**/.nuget/**,**/packages/**,src/MinimalLambda.Testing/HostFactoryResolver.cs" \ | |
| /d:sonar.coverage.exclusions="**/*" \ | |
| /d:sonar.token="$SONAR_TOKEN" | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release /p:TreatWarningsAsErrors=true | |
| - name: Run tests | |
| run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | |
| - name: Stop SonarQube | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: ~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="$SONAR_TOKEN" | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage/**/coverage.cobertura.xml | |
| disable_search: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true |