Update Unit tests to use cached fhir packages.
This commit is contained in:
Gino Canessa 2024-09-09 09:52:01 -05:00
Родитель ad3ccb20db
Коммит bf3af98033
2 изменённых файлов: 50 добавлений и 9 удалений

54
.github/workflows/build-and-test.yml поставляемый
Просмотреть файл

@ -12,6 +12,47 @@ env:
DOTNET_VERSION: '8' # The .NET SDK version to use
jobs:
cache-fhir-packages:
runs-on: ubuntu-latest
steps:
# Try to use a cached set of packages for Unit Testing
- name: Check for a FHIR package cache
id: cache-fhir-packages-test
uses: actions/cache@v4
with:
path: ~/.fhir
key: cache-unit-test-fhir-packages-20240909
enableCrossOsArchive: true
lookup-only: true
# If there is no cache, pre-download the packages we need
- name: Install FHIR packages
if: ${{ steps.cache-fhir-packages-test.outputs.cache-hit != 'true' }}
continue-on-error: true
run: |
dotnet tool install -g firely.terminal
fhir install hl7.fhir.r2.core 1.0.2
fhir install hl7.fhir.r2.expansions 1.0.2
fhir install hl7.fhir.r3.core 3.0.2
fhir install hl7.fhir.r3.expansions 3.0.2
fhir install hl7.fhir.r4.core 4.0.1
fhir install hl7.fhir.r4.expansions 4.0.1
fhir install hl7.fhir.r4b.core 4.3.0
fhir install hl7.fhir.r4b.expansions 4.3.0
fhir install hl7.fhir.r5.core 5.0.0
fhir install hl7.fhir.r5.expansions 5.0.0
# If there is no cache, save the downloaded packages
- name: Cache FHIR packages
uses: actions/cache/save@v4
if: ${{ steps.cache-fhir-packages-test.outputs.cache-hit != 'true' }}
continue-on-error: true
with:
path: ~/.fhir
key: cache-unit-test-fhir-packages-20240909
enableCrossOsArchive: true
build-and-test:
name: build-and-test-${{matrix.os}}
@ -22,11 +63,16 @@ jobs:
steps:
- uses: actions/checkout@v4
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
# Try to use a cached set of packages for Unit Testing
- name: Restore FHIR package cache
id: cache-fhir-packages
uses: actions/cache@v4
with:
path: ~/.fhir
key: cache-unit-test-fhir-packages-20240909
enableCrossOsArchive: true
- name: Install dependencies
run: dotnet restore

Просмотреть файл

@ -375,11 +375,6 @@ public partial class DefinitionCollection
? []
: sd.Snapshot?.Element ?? [];
if (sd.Id == "example-section-library")
{
Console.Write("");
}
// process each element in the snapshot
foreach (ElementDefinition ed in elements)
{