Skip to content

Commit ba952af

Browse files
committed
NCBC-4105: Add GHA workflow to build & test
Motivation ---------- Gives us an easier and redundant building and testing solution for when Jenkins runners are down/in a bad state. Changes ------- - Added a workflow to build and run unit tests on: windows, ubuntu24-[x86, arm], macos-arm with .NET 6, 8, 10 installed (.NET 4.8 should be pre-installed on windows machines) Change-Id: I9a25233e8276520b8e25b7995d47447ca1668a41 Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/236842 Tested-by: Emilien Bevierre <emilien.bevierre@couchbase.com> Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
1 parent 2628cf5 commit ba952af

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build & Run Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*'
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-test:
13+
name: Build and Unit Tests (${{ matrix.os }})
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-24.04, ubuntu-24.04-arm64, windows-latest, macos-latest]
19+
env:
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
21+
DOTNET_NOLOGO: 1
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup .NET SDK
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: |
30+
8.0.x
31+
10.0.x
32+
cache: false
33+
34+
- name: Restore
35+
run: dotnet restore couchbase-net-client.sln
36+
37+
- name: Build (Release)
38+
run: dotnet build couchbase-net-client.sln --configuration Release --no-restore
39+
40+
- name: Test - Couchbase.UnitTests
41+
run: dotnet test tests/Couchbase.UnitTests/Couchbase.UnitTests.csproj --configuration Release --no-build --logger "trx;LogFileName=unit-tests.trx" --results-directory "TestResults"
42+
43+
- name: Upload Test Results
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: unit-test-results-${{ matrix.os }}
48+
path: TestResults

0 commit comments

Comments
 (0)