@@ -34,36 +34,36 @@ jobs:
34
34
id : gitversion # step id used as reference for output values
35
35
uses :
gittools/actions/gitversion/[email protected]
36
36
37
- - uses : actions/setup-java@v3
38
- with :
39
- distribution : ' microsoft' # See 'Supported distributions' for available options
40
- java-version : ' 11'
41
-
42
- - name : Setup SonarScanner
43
- run : dotnet tool install --tool-path tools dotnet-sonarscanner
44
-
45
- - name : Setup ReportGenerator
46
- run : dotnet tool install --tool-path tools dotnet-reportgenerator-globaltool
47
-
48
- - name : SonarScanner begin
49
- run : tools/dotnet-sonarscanner begin /k:"SqlBackupTools" /o:"lucca" /v:${{ env.GitVersion_FullSemVer }} /d:sonar.login=${{ secrets.SONAR_TOKEN }} /d:sonar.host.url="https://sonarcloud.io/" /d:sonar.coverageReportPaths="./sonarCoverage/SonarQube.xml"
50
-
51
- - name : SqlServer
52
- run : choco install sql-server-2019 -y --params="'/Q /SUPPRESSPRIVACYSTATEMENTNOTICE /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /SkipRules=RebootRequiredCheck /FEATURES=SQLENGINE /SECURITYMODE=SQL /TCPENABLED=1 /SAPWD=BiSMwdaaSZ8JD5dEhx8fj9q3CFLnnrXq'"
37
+ - name : LocalDB
38
+ run : |
39
+ Write-Host "Downloading"
40
+ Import-Module BitsTransfer
41
+ Start-BitsTransfer -Source https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SqlLocalDB.msi -Destination SqlLocalDB.msi
42
+ Write-Host "Installing"
43
+ try {
44
+ Start-Process -FilePath "SqlLocalDB.msi" -Wait -ArgumentList "/qn", "/norestart", "/l*v SqlLocalDBInstall.log", "IACCEPTSQLLOCALDBLICENSETERMS=YES"
45
+ }
46
+ catch {
47
+ Write-Host "Installation failed"
48
+ Get-Content SqlLocalDBInstall.log
49
+ throw
50
+ }
51
+
52
+ Write-Host "Checking"
53
+ try {
54
+ sqlcmd -l 60 -S "(localdb)\MSSQLLocalDB" -Q "SELECT @@VERSION;"
55
+ Write-Host "SqlLocalDB 2019 installed and accessible at (localdb)\MSSQLLocalDB"
56
+ }
57
+ catch {
58
+ Write-Host "Sqlcmd execution failed"
59
+ throw
60
+ }
53
61
54
62
- name : Test
55
- run : dotnet test --configuration Release /p:CollectCoverage=true --collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory:./coverage
63
+ run : dotnet test --configuration Release
56
64
env :
57
- TEST_SQL_INSTANCE : Data Source=localhost;Initial Catalog=master;User Id=sa;Password=BiSMwdaaSZ8JD5dEhx8fj9q3CFLnnrXq;
65
+ TEST_SQL_INSTANCE : (localdb)\MSSQLLocalDB
58
66
59
- - name : Merge coverages
60
- run : tools/reportgenerator -reports:./coverage/*/*.xml -targetdir:./sonarCoverage -reporttypes:SonarQube
61
-
62
- - name : SonarScanner end
63
- run : tools/dotnet-sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}
64
- env :
65
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66
-
67
67
- name : Pack
68
68
if : startsWith(github.ref, 'refs/tags/')
69
69
run : dotnet publish src\SqlBackupTools\SqlBackupTools.csproj -c Release -o published -r win10-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix="${{ env.GitVersion_SemVer }}" /p:AssemblyVersion="${{ env.GitVersion_AssemblySemVer }}"
0 commit comments