-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 2.6 KB
/
test.yml
File metadata and controls
95 lines (82 loc) · 2.6 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
# CI: build, format-check, and run unit tests for the F# SDK.
#
# Action pinning policy:
# - First-party actions (actions/*) are pinned to a major tag (e.g. @v4).
# - Third-party actions are pinned to a full commit SHA with a version comment.
#
# .NET version is governed by global.json (sdk 10.0.203, rollForward latestFeature).
# TargetFramework (net10.0) comes from Directory.Build.props and is the sole matrix entry.
name: test
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "LICENSE"
- ".gitignore"
- ".editorconfig"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "LICENSE"
- ".gitignore"
- ".editorconfig"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
test:
name: test (${{ matrix.tfm }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
tfm: [net10.0]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup .NET (from global.json)
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', '**/*.fsproj', 'global.json', 'nuget.config') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore .NET tools (fantomas)
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore ARCP.slnx
- name: Format check (fantomas)
run: dotnet fantomas --check src tests samples
- name: Build
run: dotnet build ARCP.slnx --configuration Release --no-restore
- name: Test (unit)
run: >
dotnet test tests/ARCP.UnitTests/ARCP.UnitTests.fsproj
--configuration Release
--no-build
--verbosity normal
--logger "trx;LogFileName=unit-tests.trx"
--logger "console;verbosity=normal"
--results-directory ${{ github.workspace }}/TestResults
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-${{ matrix.tfm }}
path: ${{ github.workspace }}/TestResults
if-no-files-found: ignore
retention-days: 7