diff --git a/.github/workflows/_quality.yml b/.github/workflows/_quality.yml index 77e818e85..0e21097d4 100644 --- a/.github/workflows/_quality.yml +++ b/.github/workflows/_quality.yml @@ -12,12 +12,23 @@ on: required: false default: false type: boolean + run_backend: + description: Run backend quality checks + required: false + default: true + type: boolean + run_frontend: + description: Run frontend quality checks + required: false + default: true + type: boolean permissions: contents: read jobs: backend: + if: inputs.run_backend runs-on: ubuntu-latest timeout-minutes: 30 env: @@ -77,6 +88,7 @@ jobs: run: cargo test --test main --locked frontend: + if: inputs.run_frontend runs-on: ubuntu-latest timeout-minutes: 15 env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65f61af8f..998d6a386 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 outputs: + backend: ${{ steps.filter.outputs.backend }} + frontend: ${{ steps.filter.outputs.frontend }} container: ${{ steps.filter.outputs.container }} steps: - name: Checkout @@ -28,11 +30,18 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} fetch-depth: 0 - - name: Detect container changes + - name: Detect affected checks id: filter uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 with: filters: | + backend: + - 'backend/**' + - 'release/version.yaml' + - '.github/workflows/**' + frontend: + - 'frontend/**' + - '.github/workflows/**' container: - 'backend/**' - 'frontend/**' @@ -43,12 +52,15 @@ jobs: - '.github/workflows/ci.yml' quality: + needs: changes uses: ./.github/workflows/_quality.yml with: ref: ${{ github.event.pull_request.head.sha || github.sha }} + run_backend: ${{ needs.changes.outputs.backend == 'true' }} + run_frontend: ${{ needs.changes.outputs.frontend == 'true' }} container: - needs: [changes, quality] + needs: changes if: needs.changes.outputs.container == 'true' permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f1b2e572..1bb99373a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -165,7 +165,7 @@ jobs: build-docker-binary: name: build-docker-binary (${{ matrix.os }}-${{ matrix.arch }}) - needs: [release-info, quality] + needs: release-info strategy: fail-fast: false matrix: ${{ fromJson(needs.release-info.outputs.docker_matrix) }} @@ -225,7 +225,7 @@ jobs: build-binary: name: build-binary (${{ matrix.os }}-${{ matrix.arch }}) - needs: [release-info, quality] + needs: release-info strategy: fail-fast: false matrix: ${{ fromJson(needs.release-info.outputs.non_docker_matrix) }}