Skip to content

Commit dcf63ca

Browse files
Run tests also on Linux in GitHub Actions (#233)
* Initial plan * Add ubuntu-latest to build matrix to run tests on Linux Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
1 parent 7397a4f commit dcf63ca

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: windows-latest
12+
strategy:
13+
matrix:
14+
os: [windows-latest, ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
1316
permissions:
1417
contents: read
1518
id-token: write
@@ -32,21 +35,23 @@ jobs:
3235
run: dotnet test src/NLog.MailKit.sln --configuration Release --no-build
3336

3437
- name: Pack
38+
if: matrix.os == 'windows-latest'
3539
run: dotnet pack src/NLog.MailKit.sln --no-build --configuration Release --output artifacts
3640

3741
- name: Upload nuget package
42+
if: matrix.os == 'windows-latest'
3843
uses: actions/upload-artifact@v4
3944
with:
4045
name: nupkg
4146
path: artifacts/*.nupkg
4247

4348
- name: NuGet login
44-
if: github.ref == 'refs/heads/master'
49+
if: github.ref == 'refs/heads/master' && matrix.os == 'windows-latest'
4550
uses: NuGet/login@v1
4651
id: login
4752
with:
4853
user: ${{ secrets.NUGET_USER }}
4954

5055
- name: Push to NuGet.org
51-
if: github.ref == 'refs/heads/master'
56+
if: github.ref == 'refs/heads/master' && matrix.os == 'windows-latest'
5257
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)