-
Notifications
You must be signed in to change notification settings - Fork 16
183 lines (177 loc) · 6.33 KB
/
build_test.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: Build Test
on:
push:
branches:
- main
- release/*
pull_request:
branches: [ main ]
jobs:
build-test-AnalyzerRefacTests:
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for secrets leak on the repo
run: |
git clone https://github.com/awslabs/git-secrets.git target
cd target
./install.ps1
echo "Git-secrets installation completed"
git secrets --register-aws --global
echo "Added aws secret templates"
git secrets --scan -r ../
echo "Repository scan completed"
- name: Setup .NET Versions
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Install dependencies
run: dotnet restore src/Codelyzer.sln
- name: Build
run: dotnet build --configuration Release --no-restore src/Codelyzer.sln
- name: Tests for AnalyzerRefacTests
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal src/Codelyzer.sln --filter "FullyQualifiedName~Codelyzer.Analysis.Tests.AnalyzerRefacTests"
build-test-AnalyzerWithGenerator:
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for secrets leak on the repo
run: |
git clone https://github.com/awslabs/git-secrets.git target
cd target
./install.ps1
echo "Git-secrets installation completed"
git secrets --register-aws --global
echo "Added aws secret templates"
git secrets --scan -r ../
echo "Repository scan completed"
- name: Setup .NET Versions
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Install dependencies
run: dotnet restore src/Codelyzer.sln
- name: Build
run: dotnet build --configuration Release --no-restore src/Codelyzer.sln
- name: Tests for AnalyzerWithGenerator
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal src/Codelyzer.sln --filter "FullyQualifiedName~Codelyzer.Analysis.Tests.AnalyzerWithGenerator"
build-test-workspace:
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for secrets leak on the repo
run: |
git clone https://github.com/awslabs/git-secrets.git target
cd target
./install.ps1
echo "Git-secrets installation completed"
git secrets --register-aws --global
echo "Added aws secret templates"
git secrets --scan -r ../
echo "Repository scan completed"
- name: Setup .NET Versions
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Install dependencies
run: dotnet restore src/Codelyzer.sln
- name: Build
run: dotnet build --configuration Release --no-restore src/Codelyzer.sln
- name: Tests for Workspaces
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal src/Codelyzer.sln --filter "FullyQualifiedName~Codelyzer.Analysis.Workspace.Tests"
build-test-other:
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for secrets leak on the repo
run: |
git clone https://github.com/awslabs/git-secrets.git target
cd target
./install.ps1
echo "Git-secrets installation completed"
git secrets --register-aws --global
echo "Added aws secret templates"
git secrets --scan -r ../
echo "Repository scan completed"
- name: Setup .NET Versions
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Install dependencies
run: dotnet restore src/Codelyzer.sln
- name: Build
run: dotnet build --configuration Release --no-restore src/Codelyzer.sln
- name: Tests
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal src/Codelyzer.sln --filter "FullyQualifiedName!~Codelyzer.Analysis.Tests.AnalyzerWithGenerator&FullyQualifiedName!~Codelyzer.Analysis.Tests.AnalyzerRefacTests&FullyQualifiedName!~Codelyzer.Analysis.Workspace.Tests"
deploy:
needs: [build-test-AnalyzerRefacTests, build-test-AnalyzerWithGenerator, build-test-other, build-test-workspace]
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for secrets leak on the repo
run: |
git clone https://github.com/awslabs/git-secrets.git target
cd target
./install.ps1
echo "Git-secrets installation completed"
git secrets --register-aws --global
echo "Added aws secret templates"
git secrets --scan -r ../
echo "Repository scan completed"
- name: Setup .NET Versions
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore src/Codelyzer.sln
- name: Build
run: dotnet build --configuration Release --no-restore src/Codelyzer.sln
- name: Pack
if: ${{ github.event_name == 'push' }}
run: dotnet pack --configuration Release --no-restore -o dist src/Codelyzer.sln
- name: Install Sleet
if: ${{ github.event_name == 'push' }}
run: dotnet tool install -g sleet --version 3.2.0
- name: "Configure AWS Credentials"
if: ${{ github.event_name == 'push' }}
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
aws-region: us-west-2
- name: Publish
if: ${{ github.event_name == 'push' }}
run: sleet push dist --source s3Feed --verbose