Skip to content

Merge pull request #314 from HicServices/develop #860

Merge pull request #314 from HicServices/develop

Merge pull request #314 from HicServices/develop #860

Workflow file for this run

name: Build, test and package
on: push
env:
MSSQL_SA_PASSWORD: "YourStrong!Passw0rd"
ACCEPT_EULA: "Y"
MSSQL_PID: "developer"
jobs:
package:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Get version
id: version
shell: cmd
run: |
for /f tokens^=1^,2^ delims^=^" %%i in (SharedAssemblyInfo.cs) do @if "%%i"=="[assembly: AssemblyVersion(" echo ::set-output name=version::%%j
for /f tokens^=2^,4^ delims^=^" %%i in (Rdmp.Dicom/Rdmp.Dicom.csproj) do @if "%%i"=="HIC.RDMP.Plugin" echo ::set-output name=rdmpversion::%%j
- name: Install MS SQL 2019
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install sqllocaldb
- name: Set up database
run: |
SqlLocalDB.exe create MSSQLLocalDB -s
Invoke-WebRequest -Uri https://github.com/HicServices/RDMP/releases/download/v${{ steps.version.outputs.rdmpversion }}/rdmp-${{ steps.version.outputs.rdmpversion }}-cli-win-x64.zip -OutFile rdmp.zip
Expand-Archive -Path rdmp.zip -DestinationPath .\rdmpcli
sqlcmd -l 180 -S "(localdb)\MSSQLLocalDB" -Q "SELECT @@VERSION;"
cmd.exe /c rdmpcli\rdmp.exe install --createdatabasetimeout 180 "(localdb)\MSSQLLocalDB" TEST_
- name: Test
run: |
dotnet test -c Release
- name: Build
run: |
cd Plugin/windows
dotnet publish --runtime win-x64 -c Release --self-contained false -nologo
cd ../main
dotnet publish --runtime win-x64 -c Release --self-contained false -nologo
dotnet publish --runtime linux-x64 -c Release --self-contained false -nologo
cd ../..
nuget pack ./Rdmp.Dicom.nuspec -Properties Configuration=Release -IncludeReferencedProjects -Symbols -Version ${{ steps.version.outputs.version }}
nuget pack ./Rdmp.Dicom.Library.nuspec -Properties Configuration=Release -IncludeReferencedProjects -Symbols -Version ${{ steps.version.outputs.version }}
cp Databases.Integration.yaml .\rdmpcli\Databases.yaml
cmd /c rdmpcli\rdmp.exe pack --file Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg
cmd /c rdmpcli\rdmp.exe cmd listsupportedcommands
cmd /c rdmpcli\rdmp.exe cmd describe CreateNewImagingDatasetSuite
- name: Get Imaging Template
run: |
Invoke-WebRequest -Uri https://raw.githubusercontent.com/HicServices/DicomTypeTranslation/main/Templates/CT.it -OutFile D:\a\RdmpDicom\CT.it
- name: Integration Tests
run: |
cmd /c rdmpcli\rdmp.exe cmd NewObject ConnectionStringKeyword MicrosoftSqlServer TrustServerCertificate yes
cmd /c rdmpcli\rdmp.exe cmd NewObject ConnectionStringKeyword MicrosoftSqlServer Encrypt yes
cmd /c rdmpcli\rdmp.exe cmd CreateNewImagingDatasetSuite "DatabaseType:MicrosoftSqlServer:Name:ImagingTest:Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Encrypt=yes;TrustServerCertificate=true" ./data DicomFileCollectionSource CT_ ../CT.it false true
cmd /c rdmpcli\rdmp.exe cmd AddTag Catalogue:CT_ImageTable StudyDate null
cmd /c rdmpcli\rdmp.exe cmd AddTag Catalogue:CT_*Table SeriesDate null
cmd /c rdmpcli\rdmp.exe cmd AddTag Catalogue:CT_*Table SeriesDate null
cmd /c rdmpcli\rdmp.exe cmd AddTag Catalogue:CT_*Table SeriesDate null
cmd /c rdmpcli\rdmp.exe cmd CreateNewImagingDatasetSuite "DatabaseType:MicrosoftSqlServer:Name:ImagingTest2:Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Encrypt=yes;TrustServerCertificate=true" ./data DicomFileCollectionSource CT_ ../CT.it false true
- name: Nuget push
if: contains(github.ref,'refs/tags/')
run: nuget push HIC.Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_KEY }} -SkipDuplicate
- name: Store created nupkg files
uses: actions/upload-artifact@v3
with:
path: ./*.nupkg
retention-days: 1
- name: Upload release binaries
if: contains(github.ref,'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: 'Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg'