Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/SMI/RdmpDicom into task/…
Browse files Browse the repository at this point in the history
…bump-rdmp-version
  • Loading branch information
JFriel committed Jul 2, 2024
2 parents d0c8358 + 98896b0 commit 45f67ec
Show file tree
Hide file tree
Showing 129 changed files with 9,206 additions and 8,733 deletions.
13 changes: 6 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: develop
schedule:
interval: daily
interval: weekly
reviewers:
- SMI/reviewers
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: develop
interval: weekly
open-pull-requests-limit: 99
reviewers:
- tznind
- jas88
- SMI/reviewers
64 changes: 64 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "CodeQL"

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: "53 5 * * 5"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ csharp ]

steps:
- name: Checkout RdmpDicom source
uses: actions/checkout@v4
- name: Checkout RDMP source
uses: actions/checkout@v4
with:
repository: HicServices/RDMP
ref: develop
path: RDMP

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
upload: False
output: sarif-results

- name: filter-sarif
uses: advanced-security/filter-sarif@v1
with:
patterns: |
+**/*
-**/RDMP/**
input: sarif-results/csharp.sarif
output: sarif-results/csharp.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/csharp.sarif

119 changes: 75 additions & 44 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,73 +11,104 @@ jobs:
package:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- name: Checkout RdmpDicom source
uses: actions/checkout@v4
- name: Checkout RDMP source
uses: actions/checkout@v4
with:
repository: HicServices/RDMP
ref: develop
path: RDMP
- uses: actions/setup-dotnet@v4
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
for /f tokens^=1^,2^ delims^=^" %%i in (SharedAssemblyInfo.cs) do @if "%%i"=="[assembly: AssemblyVersion(" echo version=%%j>> %GITHUB_OUTPUT%
perl -ne "print """rdmpversion=""".$1."""\n""" if /version>(.+)</i" RDMP\directory.build.props >>%GITHUB_OUTPUT%
- name: Install MS SQL 2019
uses: crazy-max/ghaction-chocolatey@v2
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install sqllocaldb
args: install -ry sqllocaldb wget
- name: Build
run: dotnet build -c Release --nologo
- 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
dotnet run --project RDMP\Tools\rdmp\rdmp.csproj -c Release -- install --createdatabasetimeout 180 "(localdb)\MSSQLLocalDB" TEST_
- name: Package
shell: bash
run: |
dotnet test -c Release
- name: Build
wget https://raw.githubusercontent.com/SMI/DicomTypeTranslation/main/Templates/CT.it
dotnet publish Rdmp.Dicom/Rdmp.Dicom.csproj -o p/main -c Release --self-contained false -nologo
dotnet publish Rdmp.Dicom.UI/Rdmp.Dicom.UI.csproj -o p/windows -c Release --self-contained false -nologo
cat > plugin.nuspec <<EOP
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Rdmp.Dicom</id>
<version>${{ steps.version.outputs.version }}</version>
<authors>Health Informatics Service, University of Dundee</authors>
<description>Imaging plugin for Research Data Management Platform </description>
<dependencies>
<dependency id="HIC.RDMP.Plugin" version="${{ steps.version.outputs.rdmpversion }}" />
</dependencies>
</metadata>
</package>
EOP
rm -f p/windows/windows.dll
rm -f p/windows/ja-JP/Terminal.Gui.resources.dll
rm -f p/windows/fr-FR/Terminal.Gui.resources.dll
rm -f p/windows/pt-PT/Terminal.Gui.resources.dll
rm -f p/main/main.dll
rm -f p/main/ja-JP/Terminal.Gui.resources.dll
rm -f p/main/fr-FR/Terminal.Gui.resources.dll
rm -f p/main/pt-PT/Terminal.Gui.resources.dll
7z a -tzip Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg plugin.nuspec p
dotnet pack Rdmp.Dicom/Rdmp.Dicom.csproj -c Release -p:Version=${{ steps.version.outputs.version }} -p:SymbolPackageFormat=snupkg --include-source --include-symbols -o .
cat > testcmd.yaml <<-EOC
Commands:
- listsupportedcommands
- describe CreateNewImagingDatasetSuite
- NewObject ConnectionStringKeyword MicrosoftSqlServer TrustServerCertificate yes
- NewObject ConnectionStringKeyword MicrosoftSqlServer Encrypt yes
- createnewexternaldatabaseserver LiveLoggingServer_ID "DatabaseType:MicrosoftSqlServer:Name:ImagingTest:Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Encrypt=yes;TrustServerCertificate=true"
- CreateNewImagingDatasetSuite "DatabaseType:MicrosoftSqlServer:Name:ImagingTest:Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Encrypt=yes;TrustServerCertificate=true" ./data DicomFileCollectionSource CT_ CT.it false true
- AddTag Catalogue:CT_ImageTable StudyDate null
- AddTag Catalogue:CT_*Table SeriesDate null
- AddTag Catalogue:CT_*Table SeriesDate null
- AddTag Catalogue:CT_*Table SeriesDate null
- CreateNewImagingDatasetSuite "DatabaseType:MicrosoftSqlServer:Name:ImagingTest2:Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Encrypt=yes;TrustServerCertificate=true" ./data DicomFileCollectionSource CT_ CT.it false true
EOC
- name: Test
shell: bash
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
echo "Loading plugin"
dotnet run --project RDMP\\Tools\\rdmp\\rdmp.csproj -c Release -- pack -p --file Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg --dir yaml
7z t Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg
cp Rdmp.Dicom.${{ steps.version.outputs.version }}.nupkg Rdmp.Dicom.${{ steps.version.outputs.version }}.rdmp
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
echo "Running plugin test script"
dotnet run --project RDMP\\Tools\\rdmp\\rdmp.csproj -c Release -- -f testcmd.yaml --dir yaml
- name: Store created nupkg files
uses: actions/upload-artifact@v4
with:
path: |
./*.rdmp
./*.nupkg
retention-days: 1
path: |
./*.nupkg
./*.rdmp
retention-days: 1
- name: Nuget push
if: contains(github.ref,'refs/tags/')
run: dotnet nuget push HIC.Rdmp.Dicom.*.nupkg -k ${{ secrets.NUGET_KEY }} --skip-duplicate --source https://api.nuget.org/v3/index.json
- 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_glob: true
file: 'Rdmp.Dicom.${{ steps.version.outputs.version }}.*'

4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "RDMP"]
path = RDMP
url = https://github.com/HicServices/RDMP.git
branch = feature/rc4
10 changes: 10 additions & 0 deletions .linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
files:
- ./Documentation/DataExtraction.md
- ./Documentation/Caching.md
- ./Documentation/NlpPlugin.md
- ./Documentation/DataLoad.md
- ./CHANGELOG.md
- ./Rdmp.Dicom/PipelineComponents/PrimaryKeyCollisionIsolationMutilation.md
- ./README.md
- ./.github/ISSUE_TEMPLATE/bug_report.md
- ./Packages.md
Loading

0 comments on commit 45f67ec

Please sign in to comment.