-
Notifications
You must be signed in to change notification settings - Fork 478
92 lines (85 loc) · 3.85 KB
/
source-generator-ci.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Source Generator CI
on:
workflow_dispatch:
push:
branches:
- feature/annotations
pull_request:
jobs:
source-generator-build-pack-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100-rc.2.23502.2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_AWS_ACCESS_KEY_SECRET }}
aws-region: us-west-2
role-to-assume: ${{ secrets.CI_TEST_RUNNER_ROLE }}
role-duration-seconds: 3600
role-session-name: test-runner
role-skip-session-tagging: true
- name: Restore dependencies
run: |
dotnet restore Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj
dotnet restore Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Amazon.Lambda.Annotations.SourceGenerators.Tests.csproj
dotnet restore Libraries/test/TestServerlessApp.IntegrationTests/TestServerlessApp.IntegrationTests.csproj
- name: Build
run: |
dotnet build Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj --no-restore --configuration Release
dotnet build Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Amazon.Lambda.Annotations.SourceGenerators.Tests.csproj --no-restore --configuration Release
dotnet build Libraries/test/TestServerlessApp.IntegrationTests/TestServerlessApp.IntegrationTests.csproj --no-restore --configuration Release
- name: Pack
run: dotnet pack Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj -p:NuspecFile=../Amazon.Lambda.Annotations.nuspec --no-build --configuration Release --output "PackResults"
- name: Upload pack results
uses: actions/upload-artifact@v2
with:
name: source-generator-nuget-package
path: PackResults
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Test
run: |
dotnet test Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Amazon.Lambda.Annotations.SourceGenerators.Tests.csproj --no-build --configuration Release --verbosity normal --logger trx --results-directory "TestResults"
dotnet test Libraries/test/TestServerlessApp.IntegrationTests/TestServerlessApp.IntegrationTests.csproj --no-build --configuration Release --verbosity normal --logger trx --results-directory "TestResults"
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: source-generator-test-result
path: TestResults
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
test-app-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100-rc.2.23502.2
- name: Restore dependencies
run: dotnet restore Libraries/test/TestServerlessApp/TestServerlessApp.csproj
- name: Build
run: dotnet build Libraries/test/TestServerlessApp/TestServerlessApp.csproj --no-restore --configuration Release --verbosity detailed
- name: Upload built assemblies
uses: actions/upload-artifact@v2
with:
name: test-app-build-result
path: Libraries/test/TestServerlessApp/bin/Debug/netcoreapp3.1