-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.13 KB
/
cross-platform.yml
File metadata and controls
71 lines (60 loc) · 2.13 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
name: Cross-platform verification
on:
push:
branches: [main, develop]
paths-ignore:
- "**.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
pull_request:
paths-ignore:
- "**.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
workflow_dispatch:
concurrency:
group: cross-platform-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
verify:
name: Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET SDK 10.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Install libsecret + dbus + gnome-keyring (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libsecret-1-0 dbus dbus-x11 gnome-keyring
- name: Restore
run: dotnet restore CredentialCache.sln
- name: Build
run: dotnet build CredentialCache.sln --configuration Release --no-restore
- name: Test (non-Linux)
if: runner.os != 'Linux'
run: dotnet test --project CredentialCache.Test/CredentialCache.Test.csproj --configuration Release --no-build
- name: Test (Linux, under dbus session with gnome-keyring)
if: runner.os == 'Linux'
shell: bash
# The LinuxSecretServiceCredentialStore tests need a running Secret
# Service. We spin up a private dbus session, start gnome-keyring-daemon
# inside it, unlock with an empty password, then run the test runner
# within the same session so libsecret can reach the daemon.
run: |
dbus-run-session -- bash -c '
printf "\n" | gnome-keyring-daemon --unlock --components=secrets >/dev/null 2>&1 &
sleep 1
dotnet test --project CredentialCache.Test/CredentialCache.Test.csproj --configuration Release --no-build
'