-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (49 loc) · 1.8 KB
/
build.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
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201
- name: Install dependencies
run: dotnet restore
working-directory: src/ConsoleDynamoDbRepository
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: src/ConsoleDynamoDbRepository
- name: Restore and build test
run: dotnet build
working-directory: test/DynamoDbRepository.Tests
- name: Test
run: >
AWS_ACCESS_KEY_ID=abc AWS_SECRET_ACCESS_KEY=xyz
dotnet test --no-build
/p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
working-directory: test/DynamoDbRepository.Tests
- name: Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: test/DynamoDbRepository.Tests/TestResults/coverage.info
- name: Create Nuget package
run: dotnet pack --configuration Release --no-build -p:PackageVersion=0.0.$GITHUB_RUN_NUMBER
working-directory: src/DynamoDbRepository
- name: Configure Nuget for Github packages
run: >
dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
-n github -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
--store-password-in-clear-text
working-directory: src/DynamoDbRepository
- name: Publish Nuget package - Github packages
run: >
dotnet nuget push **/*.nupkg
--source github
working-directory: src/DynamoDbRepository