Skip to content

Commit 328dac9

Browse files
committed
Replace multi-platform test matrix with streamlined .NET version test workflow, adjust solution files to include new workflow.
1 parent 183e6aa commit 328dac9

File tree

3 files changed

+71
-140
lines changed

3 files changed

+71
-140
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test .NET Versions
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test-dotnet-versions:
8+
name: Test on ${{ matrix.target-framework }}
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- target-framework: net6.0
16+
dotnet-version: '6.0.x'
17+
- target-framework: net7.0
18+
dotnet-version: '7.0.x'
19+
- target-framework: net8.0
20+
dotnet-version: '8.0.x'
21+
- target-framework: net9.0
22+
dotnet-version: '9.0.x'
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup .NET ${{ matrix.dotnet-version }}
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: ${{ matrix.dotnet-version }}
32+
33+
- name: Set up Docker Compose
34+
uses: docker/setup-compose-action@v1
35+
36+
- name: Start Docker Compose services
37+
working-directory: ./src/NullOpsDevs.LibSsh.Test
38+
run: docker compose up --build -d
39+
40+
- name: Wait for SSH server to be ready
41+
run: |
42+
echo "Waiting for SSH server to start..."
43+
sleep 5
44+
45+
- name: Setup SSH Agent
46+
run: |
47+
eval $(ssh-agent -s)
48+
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
49+
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
50+
cp src/NullOpsDevs.LibSsh.Test/docker/test-keys/id_rsa /tmp/id_rsa
51+
chmod 600 /tmp/id_rsa
52+
ssh-add /tmp/id_rsa
53+
54+
- name: Restore dependencies
55+
run: dotnet restore
56+
57+
- name: Build library for ${{ matrix.target-framework }}
58+
run: dotnet build -c Release --no-restore -f ${{ matrix.target-framework }}
59+
60+
- name: Build test project for ${{ matrix.target-framework }}
61+
run: dotnet build -c Release --self-contained -r linux-x64 -f ${{ matrix.target-framework }} ./src/NullOpsDevs.LibSsh.Test/NullOpsDevs.LibSsh.Test.csproj
62+
63+
- name: Run tests
64+
working-directory: ./src/NullOpsDevs.LibSsh.Test/bin/Release/${{ matrix.target-framework }}/linux-x64/
65+
run: ./NullOpsDevs.LibSsh.Test
66+
67+
- name: Cleanup Docker Compose
68+
if: always()
69+
working-directory: ./src/NullOpsDevs.LibSsh.Test
70+
run: docker compose down -v

.github/workflows/test-matrix.yml

Lines changed: 0 additions & 140 deletions
This file was deleted.

src/NullOpsDevs.LibSsh.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<File Path="../.github\workflows\test.yml" />
44
<File Path="../.github\workflows\publish.yml" />
55
<File Path="..\.github\workflows\docs-workflow.yml" />
6+
<File Path="..\.github\workflows\test-dotnet-versions.yml" />
67
</Folder>
78
<Project Path="NullOpsDevs.Libssh.NuGetTest\NullOpsDevs.Libssh.NuGetTest.csproj" Type="Classic C#" />
89
<Project Path="NullOpsDevs.LibSsh.Test\NullOpsDevs.LibSsh.Test.csproj" Type="Classic C#" />

0 commit comments

Comments
 (0)