-
Notifications
You must be signed in to change notification settings - Fork 12
61 lines (59 loc) · 1.87 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
name: Build Test
on:
push:
branches:
- main
- release/*
pull_request:
branches: [ main ]
jobs:
build:
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@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore src/CTA.Rules.sln
- name: Build
run: dotnet build --configuration Release --no-restore src/CTA.Rules.sln
- name: Test
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal src/CTA.Rules.sln
- name: Pack
if: ${{ github.event_name == 'push' }}
run: dotnet pack --configuration Release --no-restore -o dist src/CTA.Rules.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