Skip to content

Commit e55199d

Browse files
authored
Merge pull request #2719 from JKamsker/feat/macos
Add macOS coverage to CI workflow
2 parents 7ae5d1f + 736ff09 commit e55199d

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/_reusable-ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,86 @@ jobs:
9494
--logger "console;verbosity=detailed"
9595
${{ matrix.item.msbuildProps }}
9696
97+
build-macos:
98+
name: Build (macOS)
99+
runs-on: macos-latest
100+
101+
steps:
102+
- name: Check out repository
103+
uses: actions/checkout@v4
104+
with:
105+
fetch-depth: 0
106+
107+
- name: Set up .NET SDK
108+
uses: actions/setup-dotnet@v4
109+
with:
110+
dotnet-version: 8.0.x
111+
112+
- name: Restore
113+
run: dotnet restore LiteDB.sln
114+
115+
- name: Build
116+
run: dotnet build LiteDB.sln --configuration Release --no-restore /p:TestingEnabled=true
117+
118+
- name: Package build outputs
119+
run: tar -czf tests-build-macos.tar.gz LiteDB/bin/Release LiteDB/obj/Release LiteDB.Tests/bin/Release LiteDB.Tests/obj/Release
120+
121+
- name: Upload macOS test build
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: tests-build-macos
125+
path: tests-build-macos.tar.gz
126+
127+
test-macos:
128+
name: Test (macOS ${{ matrix.item.display }})
129+
runs-on: macos-latest
130+
needs: build-macos
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
item: ${{ fromJson(inputs.sdk-matrix) }}
135+
136+
steps:
137+
- name: Check out repository
138+
uses: actions/checkout@v4
139+
with:
140+
fetch-depth: 0
141+
142+
- name: Set up .NET SDK ${{ matrix.item.display }}
143+
uses: actions/setup-dotnet@v4
144+
with:
145+
dotnet-version: ${{ matrix.item.sdk }}
146+
include-prerelease: ${{ matrix.item.includePrerelease }}
147+
148+
- name: Download build artifacts
149+
uses: actions/download-artifact@v4
150+
with:
151+
name: tests-build-macos
152+
153+
- name: Extract build artifacts
154+
run: tar -xzf tests-build-macos.tar.gz
155+
156+
- name: Build test project for target framework
157+
run: >-
158+
dotnet build LiteDB.Tests/LiteDB.Tests.csproj
159+
--configuration Release
160+
--framework ${{ matrix.item.framework }}
161+
--no-dependencies
162+
${{ matrix.item.msbuildProps }}
163+
164+
- name: Run tests
165+
timeout-minutes: 5
166+
run: >-
167+
dotnet test LiteDB.Tests/LiteDB.Tests.csproj
168+
--configuration Release
169+
--no-build
170+
--framework ${{ matrix.item.framework }}
171+
--verbosity normal
172+
--settings tests.runsettings
173+
--logger "trx;LogFileName=TestResults.trx"
174+
--logger "console;verbosity=detailed"
175+
${{ matrix.item.msbuildProps }}
176+
97177
build-windows:
98178
name: Build (Windows)
99179
runs-on: windows-latest

0 commit comments

Comments
 (0)