-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (33 loc) · 1.46 KB
/
OnPush.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
# This workflow will build a .NET project
name: OnPush (Build and Publish)
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore TrelloDotNet.sln
- name: Build
run: dotnet build --configuration Release --no-restore
- name: SetUserSecretsTrelloApiKey
run: dotnet user-secrets set TrelloApiKey ${{ secrets.TRELLOAPIKEY }} --project src/TrelloDotNet.Tests/TrelloDotNet.Tests.csproj
- name: SetUserSecretsTrelloToken
run: dotnet user-secrets set TrelloToken ${{ secrets.TRELLOTOKEN }} --project src/TrelloDotNet.Tests/TrelloDotNet.Tests.csproj
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal --p:CollectCoverage=true --p:CoverletOutput=TestResults/ --p:CoverletOutputFormat=lcov
working-directory: src/TrelloDotNet.Tests
- name: Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/TrelloDotNet.Tests/TestResults/coverage.info
- name: Publish to NuGet if needed
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} -SkipDuplicate