diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eec54868a..d5e1870ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" @@ -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: @@ -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." @@ -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 diff --git a/.github/workflows/frontend-build.yml b/.github/workflows/frontend-build.yml index e95679775..580c2ed6c 100644 --- a/.github/workflows/frontend-build.yml +++ b/.github/workflows/frontend-build.yml @@ -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 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 2f271beff..000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Integration Check - -on: - workflow_call: - inputs: - node_version: - required: true - type: string - -permissions: - contents: read - -jobs: - integration: - runs-on: ubuntu-latest - defaults: - run: - working-directory: src/frontend - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - - - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - with: - version: 10 - - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version: ${{ inputs.node_version }} - cache: pnpm - cache-dependency-path: src/frontend/pnpm-lock.yaml - - - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 - with: - global-json-file: global.json - - - name: Install frontend deps - run: pnpm install --frozen-lockfile - - - name: Build frontend - env: - MODE: production - ASTRO_TELEMETRY_DISABLED: 1 - run: pnpm build:production - - - name: Build AppHost - working-directory: src/apphost/Aspire.Dev.AppHost - run: dotnet build --configuration Release - - - name: Validate frontend index - run: | - if [ ! -f "dist/index.html" ]; then - echo "Frontend build incomplete - index.html not found" - exit 1 - fi - - - name: Upload integration artifacts - if: ${{ always() }} - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 - with: - name: integration-artifacts - path: | - src/frontend/dist - src/apphost/Aspire.Dev.AppHost/bin/Release/*/ - if-no-files-found: warn - retention-days: 7