-
Notifications
You must be signed in to change notification settings - Fork 157
58 lines (53 loc) · 1.52 KB
/
build-and-test.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: Build and Test
on:
push:
branches: [ 'v[1-9][0-9].0' ]
pull_request:
branches: [ 'v[1-9][0-9].0' ]
schedule:
- cron: 0 6 * * 1
jobs:
automerge:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3.10.1
with:
use-github-auto-merge: true
build-and-test:
name: build-and-test on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Get Build Information
run: |
pwd
dotnet --info
dotnet --version
- name: Set up dependency caching for faster builds
uses: actions/cache@v4
id: nuget-cache
with:
path: |
~/.nuget/packages
${{ github.workspace }}/**/obj/project.assets.json
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --no-restore --verbosity normal