Skip to content

Commit

Permalink
Fail LocalWebApp build if viewer not found to embed (#1234)
Browse files Browse the repository at this point in the history
* Fail LocalWebApp build if viewer not found to embed

* Build viewer before FwLite in CI
  • Loading branch information
myieye authored Nov 14, 2024
1 parent b188a5d commit b562820
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/fw-lite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ jobs:
shortSha=$(echo ${{ github.sha }} | cut -c1-8)
echo "VERSION=v$(date --rfc-3339=date)-$shortSha" >> ${GITHUB_OUTPUT}
echo "SEMVER_VERSION=$(date +%Y.%-m.%-d)" >> ${GITHUB_OUTPUT}
- name: Build viewer
working-directory: frontend/viewer
run: |
corepack enable
pnpm install
pnpm run build-app
- name: Dotnet build
working-directory: backend/FwLite/FwLiteDesktop
run: |
Expand All @@ -55,12 +63,6 @@ jobs:
- name: Dotnet test
run: dotnet test FwLiteOnly.slnf --configuration Release --logger GitHubActions

- name: Build viewer
working-directory: frontend/viewer
run: |
corepack enable
pnpm install
pnpm run build-app
- name: Upload viewer artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions backend/FwLite/LocalWebApp/LocalWebApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
<EmbeddedResource Include="..\..\..\frontend\viewer\dist\**\*" />
</ItemGroup>

<Target Name="FailIfViewerNotEmbedded" BeforeTargets="Build">
<Error Condition="@(EmbeddedResource->Count()) == 0"
Text="The viewer app was not found. Run 'pnpm run build-app' from the viewer folder." />
</Target>

<ItemGroup Condition="$([MSBuild]::IsOsPlatform('macOS'))">
<!--
This assumes that icu4c libs are installed under "/opt/local/lib" on macOS. This is the default
Expand Down

0 comments on commit b562820

Please sign in to comment.