diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 004eaf7c..613b067f 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -28,9 +28,38 @@ jobs: - name: Lint charts run: ct lint --charts=charts/trino,charts/gateway --validate-maintainers=false + changes: + runs-on: ubuntu-latest + name: changed trino/gateway files + outputs: + trino-changed: ${{ steps.filter.outputs.trino }} + gateway-changed: ${{ steps.filter.outputs.gateway }} + steps: + - uses: actions/checkout@v4 + # Detect changes in trino/gatway files to conditionally run tests + - name: Get changed related files + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 + id: filter + with: + filters: | + trino: + - 'charts/trino/**' + - 'tests/trino/**' + - '.helmignore' + - '.github/**' + - '.gitignore' + gateway: + - 'charts/gateway/**' + - 'tests/gateway/**' + - '.helmignore' + - '.github/**' + - '.gitignore' + test: runs-on: ubuntu-latest name: test trino ${{ matrix.label }} + needs: [changes] + if: ${{needs.changes.outputs.trino-changed == 'true'}} strategy: fail-fast: false matrix: @@ -60,6 +89,8 @@ jobs: test-gateway: runs-on: ubuntu-latest name: test gateway ${{ matrix.label }} + needs: [changes] + if: ${{needs.changes.outputs.gateway-changed == 'true'}} strategy: fail-fast: false matrix: @@ -93,7 +124,7 @@ jobs: sync-readme: needs: [lint, test, test-gateway, docs] runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: ${{ always() && !failure() && github.event_name != 'pull_request'}} steps: - name: Checkout main uses: actions/checkout@v4 @@ -122,7 +153,7 @@ jobs: release: needs: [lint, test, test-gateway, docs, sync-readme] runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: ${{ always() && !failure() && github.event_name != 'pull_request'}} steps: - uses: actions/checkout@v4 with: