-
Notifications
You must be signed in to change notification settings - Fork 163
145 lines (123 loc) · 4.7 KB
/
build.yml
File metadata and controls
145 lines (123 loc) · 4.7 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build and test
on:
push:
branches:
- main
- nightly
paths-ignore:
- ".github"
- ".vscode"
pull_request:
paths-ignore:
- ".github"
- ".vscode"
jobs:
build:
env:
TEST_TIMEOUT_MINUTES: 40
FSAC_TEST_DEFAULT_TIMEOUT : 120000 #ms, individual test timeouts
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1 # needed to allow .NET RCs to participate in rollforward as expected.
DOTNET_INSTALL_DIR: ".dotnet"
timeout-minutes: 40 # we have a locking issue, so cap the runs at ~20m to account for varying build times, etc
strategy:
matrix:
os:
- windows-latest
- macos-15
- ubuntu-latest
dotnet-version: ["8.x", "9.x", "10.x"]
use-transparent-compiler:
- "TransparentCompiler"
- "BackgroundCompiler"
workspace-loader:
- "WorkspaceLoader"
# - "ProjectGraph" # this is disable because it just adds too much time to the build
# these entries will mesh with the above combinations
include:
# latest 8.0
- global-json-file: "global.json"
dotnet-version: "8.x"
include-prerelease: false
label: "8.0"
build_net9: false
build_net10: false
test_tfm: net8.0
# latest 9.0
- global-json-file: "global.json"
dotnet-version: "9.x"
include-prerelease: true
label: "9.0"
build_net9: true
build_net10: false
test_tfm: net9.0
# latest 10.0
- global-json-file: "global.json"
dotnet-version: "10.x"
include-prerelease: true
label: "10.0"
build_net9: false
build_net10: true
test_tfm: net10.0
fail-fast: false # we have timing issues on some OS, so we want them all to run
runs-on: ${{ matrix.os }}
name: Build on ${{matrix.os}} for ${{ matrix.label }} ${{ matrix.workspace-loader }} ${{ matrix.use-transparent-compiler }}
steps:
- uses: actions/checkout@v3
# setup .NET per the repo global.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
# setup .NET per test session
- name: Setup .NET
id : setup-dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
# remove global.json so that the env configuration takes precedence
- name: Purge global.json
run: rm global.json
- name: Create global.json
run: dotnet new globaljson --sdk-version '${{ steps.setup-dotnet.outputs.dotnet-version }}' --roll-forward latestMinor
# let's make sure we're on the version we think we are.
- name: Announce .NET version
run: dotnet --info
- name: Restore tools
run: dotnet tool restore
- name: Check format
run: dotnet fantomas --check build.fsx src
env:
DOTNET_ROLL_FORWARD: LatestMajor
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
# Ensure the scaffolding code can still add items to the existing code.
# - name: EnsureCanScaffoldCodeFix
# run: dotnet fsi build.fsx -- -p EnsureCanScaffoldCodeFix
- name: Run Build
run: dotnet build -c Release
env:
BuildNet9: ${{ matrix.build_net9 }}
BuildNet10: ${{ matrix.build_net10 }}
- name: Run and report tests
run: dotnet test -c Release -f ${{ matrix.test_tfm }} --no-restore --no-build --logger "console;verbosity=normal" --logger GitHubActions /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="System.Reactive|FSharp.Compiler.Service|Ionide.ProjInfo|FSharp.Analyzers|Analyzer|Humanizer|FSharp.Core|FSharp.DependencyManager" -- Expecto.fail-on-focused-tests=true --blame-hang --blame-hang-timeout 1m
working-directory: test/FsAutoComplete.Tests.Lsp
env:
BuildNet9: ${{ matrix.build_net9 }}
BuildNet10: ${{ matrix.build_net10 }}
USE_TRANSPARENT_COMPILER: ${{ matrix.use-transparent-compiler }}
USE_WORKSPACE_LOADER: ${{ matrix.workspace-loader }}
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore tools
run: dotnet tool restore
- name: Run analyzers
run: dotnet build -t:AnalyzeSolution -p:TargetFramework=net8.0
# SARIF v3 requires categories to be used per file and since
# Github Actions doesn't know what a for loop is I'm just ignoring this for now.
# Otherwise we have to generate a matrix and upload the files for the next job
# to use. What a mess.
# - name: Upload SARIF file
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: analysisreports