Repository navigation
55 lines (50 loc) · 1.9 KB
/
Copy pathdotnet.yml
File metadata and controls
55 lines (50 loc) · 1.9 KB
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
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '10.0.x', '11.0.x' ]
steps:
- uses: actions/checkout@v7
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v6
id: stepid
with:
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-quality: ${{ matrix.dotnet-version == '11.0.x' && 'preview' || 'ga' }}
# - name: Create temporary global.json
# run: echo '{"sdk":{"version":"${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration=Release --no-restore
- name: Test
run: dotnet test --configuration=Release --no-build
- name: Pack NuGet packages (PR validation)
if: matrix.dotnet-version == '10.0.x' && github.event_name == 'pull_request'
run: dotnet pack --configuration=Release --no-build -p:PackageVersion=1.0.0-pr${{ github.event.pull_request.number }}.${{ github.run_number }} -o artifacts
- name: Upload NuGet packages
if: matrix.dotnet-version == '10.0.x' && github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: nuget-packages-pr${{ github.event.pull_request.number }}-run${{ github.run_number }}
path: |
artifacts/*.nupkg
artifacts/*.snupkg
# - name: Archive test results
# uses: actions/upload-artifact@v7
# if: always()
# with:
# name: TestResults
# path: |
# /home/runner/work/Activout.DatabaseClient/Activout.DatabaseClient/Activout.DatabaseClient.Test/TestResults/