-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.58 KB
/
ci.yml
File metadata and controls
52 lines (41 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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