Skip to content

Commit 782ce4f

Browse files
Fix CI to use ubuntu.
1 parent 73417ef commit 782ce4f

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed

.github/workflows/github-actions-ci.yaml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,42 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: windows-latest
11+
runs-on: ubuntu-latest
12+
services:
13+
sqlserver:
14+
image: mcr.microsoft.com/mssql/server:2022-latest
15+
env:
16+
SA_PASSWORD: "P@ssw0rd12345!"
17+
ACCEPT_EULA: "Y"
18+
ports:
19+
- 1433:1433
1220
steps:
1321
- uses: actions/checkout@v4
1422

15-
- name: Setup NuGet
16-
uses: nuget/setup-nuget@v2
17-
18-
- name: Restore NuGet packages
19-
run: nuget restore PosInformatique.Database.Updater.sln
20-
21-
- name: Add msbuild to PATH
22-
uses: microsoft/setup-msbuild@v2
23-
24-
- name: Build
25-
run: msbuild "PosInformatique.Database.Updater.sln" /p:Configuration=Debug
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: 8.0.x
2627

27-
- name: Creates the LocalDB for the tests
28-
shell: cmd
29-
run: SqlLocalDB create posinfo-tests
28+
- name: Restore dependencies
29+
run: dotnet restore PosInformatique.Database.Updater.sln
3030

31-
- name: Creates the SQL Login service accounts for the tests
32-
shell: cmd
33-
run: sqlcmd -S "(localDB)\posinfo-tests" -Q "IF NOT EXISTS (SELECT 1 FROM [sys].[server_principals] WHERE [Name] = 'ServiceAccountLogin') CREATE LOGIN [ServiceAccountLogin] WITH PASSWORD = 'P@ssw0rd'"
31+
- name: Build solution
32+
run: dotnet build PosInformatique.Database.Updater.sln --configuration Release --no-restore
3433

3534
- name: Run tests
36-
run: dotnet test --no-build --verbosity normal
37-
38-
# Use this fix https://github.com/microsoft/vstest-action/issues/31#issuecomment-2159463764
39-
- name: Test with the dotnet CLI
40-
uses: rusty-bender/vstest-action@main
35+
run: |
36+
dotnet test PosInformatique.Database.Updater.sln \
37+
--configuration Release \
38+
--no-build \
39+
--logger "trx;LogFileName=test_results.trx" \
40+
--results-directory ./TestResults
41+
env:
42+
DATABASE_UPDATER_UNIT_TESTS_CONNECTION_STRING: "Data Source=localhost,1433;Database=master;User Id=sa;Password=P@ssw0rd12345!;TrustServerCertificate=True;"
43+
44+
- name: Publish Test Results
45+
uses: EnricoMi/publish-unit-test-result-action@v2
46+
if: (!cancelled())
4147
with:
42-
searchFolder: .\
43-
testAssembly: |
44-
/tests/**/*.tests.dll
45-
!./**/*TestAdapter.dll
46-
!./**/obj/**
48+
files: |
49+
TestResults/**/*.trx

.github/workflows/github-actions-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
type: string
1313
description: The version suffix of the library (for example rc.1)
1414

15-
run-name: ${{ inputs.VersionPrefix }}-${{ inputs.VersionSuffix }}
15+
run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, inputs.VersionSuffix) || inputs.VersionPrefix }}
1616

1717
jobs:
1818
build:

0 commit comments

Comments
 (0)