-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.73 KB
/
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
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
version_suffix_args: ${{ format('/p:VersionSuffix="artifact.{0}"', github.run_number) }}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Checkout code
uses: actions/checkout@v2
- name: Restore dependencies
run: dotnet restore
source/Gravatar.sln
- name: Build
run: dotnet build
source/Gravatar.sln
--configuration Release
- name: Pack
run: dotnet pack
source/Gravatar.sln
--configuration Release
--output "${{github.workspace}}/artifacts/packages"
${{ env.version_suffix_args}}
- name: Run unit tests
run: dotnet test
source/Gravatar.sln
--configuration Release
--filter="TestCategory!=Manual"
--logger "trx;LogFilePrefix=main"
--results-directory ${{github.workspace}}/artifacts/test-results
${{ env.version_suffix_args}}
env:
GRAVATAR_API_KEY: ${{ secrets.GRAVATAR_API_KEY }}
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: build-artifacts
path: ${{github.workspace}}/artifacts