Skip to content

Run CI tests only if Trino and Gateway file change #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
35 changes: 33 additions & 2 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down