-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.16 KB
/
dotnet.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
name: .NET
on:
pull_request:
branches: ["main"]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
dotnet-version: ['8.0.x']
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install Docker
run: |
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker nonrootuser
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test test/SampleDotnet.RepositoryFactory.Tests/SampleDotnet.RepositoryFactory.Tests.csproj --no-restore --verbosity normal
- name: Publish
id: SampleDotnet_RepositoryFactory
uses: alirezanet/publish-nuget@v3.0.3
with:
PROJECT_FILE_PATH: src/SampleDotnet.RepositoryFactory/SampleDotnet.RepositoryFactory.csproj
NUGET_KEY: ${{ secrets.NUGET_KEY }}