-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (84 loc) · 2.35 KB
/
Copy pathbuild.yml
File metadata and controls
95 lines (84 loc) · 2.35 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: build
on:
push:
branches:
- "main"
paths:
- ".github/workflows/build.yml"
- "src/**"
- "test/**"
- "util/**"
- "dev/**"
- "Directory.Build.props"
- "Directory.Build.targets"
- "*.slnx"
- ".editorconfig"
pull_request:
branches:
- "main"
paths:
- ".github/workflows/build.yml"
- "src/**"
- "test/**"
- "util/**"
- "dev/**"
- "Directory.Build.props"
- "Directory.Build.targets"
- "*.slnx"
- ".editorconfig"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
actions: read
id-token: write
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: CargoWall
uses: code-cargo/cargowall-action@78f9fbcb3561c6ad9289e5b740616216e8cbd232 # v1.3.5
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup dotnet
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
with:
cache: true
cache-dependency-path: '**/packages.linux-x64.lock.json'
dotnet-version: |
8.x
10.x
- name: Verify NuGet lock files are in sync
run: |
./dev/update-nuget-lockfiles.sh
changes="$(git status --porcelain -- '*.lock.json')"
if [ -n "$changes" ]; then
echo "::error::NuGet lock files are out of date. Run ./dev/update-nuget-lockfiles.sh and commit the result."
echo "$changes"
git diff -- '*.lock.json'
exit 1
fi
- name: Build
run: dotnet build -p TreatWarningsAsErrors=true
- name: Check for BOMs
run: ./dev/check-bom.sh
- name: Check formatting
run: |
if dotnet format --no-restore --verify-no-changes; then
echo "formatting passed"
else
rc="$?"
echo "formatting failed; run 'dotnet format'" >&2
exit "$rc"
fi
- name: Unit Tests
run: dotnet test --no-build test/UnitTests/UnitTests.csproj
- name: Integration Tests
run: dotnet test --no-build test/IntegrationTests/IntegrationTests.csproj