Skip to content

Commit

Permalink
Remove debug test.
Browse files Browse the repository at this point in the history
Update Unit tests to use cached fhir packages.
  • Loading branch information
GinoCanessa committed Sep 9, 2024
1 parent ad3ccb2 commit bf3af98
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 9 deletions.
54 changes: 50 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,6 @@ private void ProcessElements(FhirArtifactClassEnum artifactClass, StructureDefin
? []
: sd.Snapshot?.Element ?? [];

if (sd.Id == "example-section-library")
{
Console.Write("");
}

// process each element in the snapshot
foreach (ElementDefinition ed in elements)
{
Expand Down

0 comments on commit bf3af98

Please sign in to comment.