-
Notifications
You must be signed in to change notification settings - Fork 41
116 lines (99 loc) · 2.97 KB
/
Copy pathci.yaml
File metadata and controls
116 lines (99 loc) · 2.97 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
name: "CI"
on:
push:
branches:
- master
tags:
- 'v*.*.*'
release:
types: [published]
pull_request:
workflow_dispatch:
# The workflow only reads the repo; publishing uses the NUGET_API_KEY secret, not the token.
permissions:
contents: read
# Cancel superseded runs on rapid PR updates; never cancel master/tag/release builds.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
HUSKY: 0
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ macOS-latest, ubuntu-latest, windows-latest ]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 25
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: |
8.x
9.x
10.x
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('Directory.Packages.props', '**/*.fsproj', '**/*.csproj') }}
restore-keys: nuget-${{ runner.os }}-
- name: Build & Test
run: dotnet fsi build.fsx -- --target Test
- name: Pack
run: dotnet fsi build.fsx -- --target Pack
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nuget-${{ matrix.os }}
path: artifacts/*.nupkg
integration:
name: Integration Tests
# ubuntu-latest is the one hosted runner with a working Docker daemon for Linux
# containers — Testcontainers needs it to start the Loki container (macOS runners
# have no Docker; Windows runners only run Windows containers).
runs-on: ubuntu-latest
needs: build
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 10.x
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('Directory.Packages.props', '**/*.fsproj', '**/*.csproj') }}
restore-keys: nuget-${{ runner.os }}-
- name: Integration Tests
run: dotnet fsi build.fsx -- --target IntegrationTest
publish:
name: Publish to NuGet
runs-on: ubuntu-latest
needs: [ build, integration ]
if: github.event_name == 'release' && github.event.action == 'published'
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 10.x
- name: Pack & Push
run: dotnet fsi build.fsx -- --target Push
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}