mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-29 16:08:38 +00:00
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
# If you change this name also do it in tests.yml and ci_metrics.yml
|
|
name: Tests
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
- ready_for_review
|
|
paths-ignore:
|
|
# we skip the tests unless the code changes. The problem is that GitHub will run the check anyway if any other
|
|
# file outside the code changed (e.g. the release notes). Hence, we need a second filter down below.
|
|
# keep the list in sync with the paths defined in the `tests.yml` workflow
|
|
- "haystack/**/*.py"
|
|
- "haystack/core/pipeline/predefined/*"
|
|
- "test/**/*.py"
|
|
|
|
jobs:
|
|
check_if_changed:
|
|
name: Check if changed
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
outputs:
|
|
code_changes: ${{ steps.changes.outputs.code_changes }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check for changed code
|
|
id: changes
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
|
|
with:
|
|
# keep the list in sync with the paths defined in the `tests.yml` workflow
|
|
filters: |
|
|
code_changes:
|
|
- haystack/**/*.py
|
|
- "haystack/templates/predefined/*"
|
|
- test/**/*.py
|
|
|
|
catch-all:
|
|
# Don't run this check if the PR contains both code and non-code changes (e.g. release notes)
|
|
needs: check_if_changed
|
|
if: needs.check_if_changed.outputs.code_changes == 'false'
|
|
name: Catch-all check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Skip tests
|
|
run: echo "Skipped!"
|