diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index c2c799604044b99e07dcd7bf0f450c1f070afc88..dbb6481e3e7f0a9d0180d7365e156a2513d7a296 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -19,9 +19,25 @@ jobs: files-changed: name: Check which files changed runs-on: ubuntu-22.04 - timeout-minutes: 6 + timeout-minutes: 5 outputs: backend_all: ${{ steps.changes.outputs.backend_all }} + steps: + - uses: actions/checkout@v3 + - name: Test which files changed + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-paths.yaml + + static-viz-files-changed: + needs: files-changed + if: needs.files-changed.outputs.backend_all != 'true' + name: Check whether static-viz files changed + runs-on: ubuntu-22.04 + timeout-minutes: 10 + outputs: static_viz: ${{ steps.static_viz.outputs.static_viz }} steps: - uses: actions/checkout@v3 @@ -31,19 +47,14 @@ jobs: uses: ./.github/actions/prepare-backend with: m2-cache-key: "files-changed" - - name: Build static viz frontend + - name: Build static-viz frontend run: yarn build-static-viz - name: Upload Static Viz Bundle Artifact uses: actions/upload-artifact@v3 with: name: static-viz-bundle-${{ github.sha }} path: resources/frontend_client/app/dist - - name: Test which files changed - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - token: ${{ github.token }} - filters: .github/file-paths.yaml + - name: Check for static viz changes uses: dorny/paths-filter@v2.11.1 id: static_viz @@ -73,8 +84,10 @@ jobs: flags: back-end be-linter-clj-kondo: - needs: files-changed - if: needs.files-changed.outputs.backend_all == 'true' || needs.files-changed.outputs.static_viz == 'true' + needs: [files-changed, static-viz-files-changed] + if: | + !cancelled() && + (needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') runs-on: ubuntu-22.04 timeout-minutes: 10 env: @@ -131,8 +144,11 @@ jobs: ./modules/drivers/vertica/test be-linter-eastwood: - needs: files-changed - if: github.event.pull_request.draft == false && (needs.files-changed.outputs.backend_all == 'true' || needs.files-changed.outputs.static_viz == 'true') + needs: [files-changed, static-viz-files-changed] + if: | + !cancelled() && + github.event.pull_request.draft == false && + (needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') runs-on: ubuntu-22.04 timeout-minutes: 20 steps: @@ -148,8 +164,11 @@ jobs: # we have to extract that job manually here. Backend developers have requested that this # test runs at all times to give them an early warning sign is something is broken. be-tests-java-11-ee-pre-check: - needs: files-changed - if: github.event.pull_request.draft == true && (needs.files-changed.outputs.backend_all == 'true' || needs.files-changed.outputs.static_viz == 'true') + needs: [files-changed, static-viz-files-changed] + if: | + !cancelled() && + github.event.pull_request.draft == true && + (needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') runs-on: ubuntu-22.04 name: be-tests-java-11-ee-pre-check timeout-minutes: 60 @@ -181,8 +200,11 @@ jobs: fail-on-error: false be-tests: - needs: files-changed - if: github.event.pull_request.draft == false && (needs.files-changed.outputs.backend_all == 'true' || needs.files-changed.outputs.static_viz == 'true') + needs: [files-changed, static-viz-files-changed] + if: | + !cancelled() && + github.event.pull_request.draft == false && + (needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') runs-on: ubuntu-22.04 name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }} timeout-minutes: 60 @@ -199,12 +221,18 @@ jobs: uses: ./.github/actions/prepare-backend with: m2-cache-key: be-tests - + # Depending on which files changed, we might either have to build static-viz + # from scratch or download the previously built artifact + - name: Build static-viz frontend + if: needs.files-changed.outputs.backend_all == 'true' + run: yarn build-static-viz - name: Download Static Viz Bundle Artifact + if: needs.static-viz-files-changed.outputs.static_viz == 'true' uses: actions/download-artifact@v3 with: name: static-viz-bundle-${{ github.sha }} path: resources/frontend_client/app/dist + - name: Run tests run: clojure -X:dev:ci:test:${{ matrix.edition }}:${{ matrix.edition }}-dev @@ -220,11 +248,11 @@ jobs: fail-on-error: false be-tests-stub: - needs: files-changed + needs: [files-changed, static-viz-files-changed] if: | always() && github.event.pull_request.draft == false && - (needs.files-changed.outputs.backend_all == 'false' && needs.files-changed.outputs.static_viz == 'false') + (needs.files-changed.outputs.backend_all == 'false' && needs.static-viz-files-changed.outputs.static_viz == 'false') runs-on: ubuntu-22.04 name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }} timeout-minutes: 5 @@ -240,8 +268,11 @@ jobs: # checks that all the namespaces we actually ship can be compiled, without any dependencies that we don't ship (such # as `:dev` dependencies). See #27009 for more context. be-check: - needs: files-changed - if: github.event.pull_request.draft == false && (needs.files-changed.outputs.backend_all == 'true' || needs.files-changed.outputs.static_viz == 'true') + needs: [files-changed, static-viz-files-changed] + if: | + !cancelled() && + github.event.pull_request.draft == false && + (needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') runs-on: ubuntu-22.04 name: be-check-java-${{ matrix.java-version }} timeout-minutes: 10 @@ -258,11 +289,11 @@ jobs: run: clojure -M:ee:drivers:check be-check-stub: - needs: files-changed + needs: [files-changed, static-viz-files-changed] if: | always() && github.event.pull_request.draft == false && - (needs.files-changed.outputs.backend_all == 'false' && needs.files-changed.outputs.static_viz == 'false') + (needs.files-changed.outputs.backend_all == 'false' && needs.static-viz-files-changed.outputs.static_viz == 'false') runs-on: ubuntu-22.04 name: be-check-java-${{ matrix.java-version }} timeout-minutes: 10