Merge pull request #2 from sl-cloud/feature/application-layer #10
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: CI Pipeline | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build solution | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Run unit tests | |
| run: dotnet test --filter "Category=Unit" --configuration Release --no-build --verbosity normal | |
| - name: Run integration tests | |
| run: dotnet test --filter "Category=Integration" --configuration Release --no-build --verbosity normal | |
| - name: Package Lambda function | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') | |
| run: | | |
| dotnet publish src/LeadProcessor.Lambda/LeadProcessor.Lambda.csproj \ | |
| --configuration Release \ | |
| --runtime linux-x64 \ | |
| --self-contained false \ | |
| --output ./publish | |
| cd ./publish | |
| zip -r ../lambda-deployment.zip . | |
| - name: Upload Lambda deployment package | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lambda-deployment-package | |
| path: lambda-deployment.zip | |
| retention-days: 30 | |