Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 23 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,32 @@ jobs:
exit 0
fi

if git diff --quiet "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" -- src/frontend; then
frontend=false
base_sha="${{ github.event.pull_request.base.sha }}"
head_sha="${{ github.event.pull_request.head.sha }}"

# If the workflow changed, build everything. if it hasn't,
# check for frontend and/or apphost changes...
if git diff --quiet "$base_sha" "$head_sha" -- .github/workflows; then
workflow=false
else
frontend=true
workflow=true
fi

if git diff --quiet "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" -- src/apphost global.json NuGet.config; then
apphost=false
else
if [[ "$workflow" == "true" ]]; then
frontend=true
apphost=true
else
if git diff --quiet "$base_sha" "$head_sha" -- src/frontend; then
frontend=false
else
frontend=true
fi

if git diff --quiet "$base_sha" "$head_sha" -- src/apphost src/statichost global.json NuGet.config; then
apphost=false
else
apphost=true
fi
fi

echo "frontend=$frontend" >> "$GITHUB_OUTPUT"
Expand All @@ -58,15 +74,8 @@ jobs:
if: ${{ needs.changes.outputs.apphost == 'true' }}
uses: ./.github/workflows/apphost-build.yml

integration-test:
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' || needs.changes.outputs.apphost == 'true' }}
uses: ./.github/workflows/integration.yml
with:
node_version: '24.x'

ci-gate:
needs: [changes, frontend-build, apphost-build, integration-test]
needs: [changes, frontend-build, apphost-build]
if: ${{ always() && !cancelled() }}
runs-on: ubuntu-latest
steps:
Expand All @@ -78,14 +87,12 @@ jobs:
APPHOST_CHANGED: ${{ needs.changes.outputs.apphost }}
FRONTEND_RESULT: ${{ needs['frontend-build'].result }}
APPHOST_RESULT: ${{ needs['apphost-build'].result }}
INTEGRATION_RESULT: ${{ needs['integration-test'].result }}
run: |
echo "changes result: $CHANGES_RESULT"
echo "frontend changed: $FRONTEND_CHANGED"
echo "frontend-build result: $FRONTEND_RESULT"
echo "apphost changed: $APPHOST_CHANGED"
echo "apphost-build result: $APPHOST_RESULT"
echo "integration-test result: $INTEGRATION_RESULT"

if [[ "$CHANGES_RESULT" != "success" ]]; then
echo "The changes job must succeed."
Expand All @@ -111,13 +118,3 @@ jobs:
echo "apphost-build should have been skipped."
exit 1
fi

if [[ "$FRONTEND_CHANGED" == "true" || "$APPHOST_CHANGED" == "true" ]]; then
if [[ "$INTEGRATION_RESULT" != "success" ]]; then
echo "integration-test should have run and succeeded."
exit 1
fi
elif [[ "$INTEGRATION_RESULT" != "skipped" ]]; then
echo "integration-test should have been skipped."
exit 1
fi
6 changes: 6 additions & 0 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
echo "Frontend build failed - dist directory not found"
exit 1
fi

if [ ! -f "dist/index.html" ]; then
echo "Frontend build incomplete - index.html not found"
exit 1
fi

ls -la dist

- name: Upload artifact
Expand Down
67 changes: 0 additions & 67 deletions .github/workflows/integration.yml

This file was deleted.