# This workflow identifies changes between the base and the head ref, for use in # other workflows to decide if they should be executed. name: Identify Changes on: workflow_call: # These inputs allow the filter action to be able to access the correct refs for # comparison in changes detection, it is required as this is called from the # merge_group context. inputs: base_ref: required: false type: string head_ref: required: false type: string int_tests: required: false type: boolean default: false e2e_tests: required: false type: boolean default: false source: required: false type: boolean default: true outputs: source: value: ${{ jobs.source.outputs.source }} dependencies: value: ${{ jobs.source.outputs.dependencies }} deny: value: ${{ jobs.source.outputs.deny }} internal_events: value: ${{ jobs.source.outputs.internal_events }} cue: value: ${{ jobs.source.outputs.cue }} component_docs: value: ${{ jobs.source.outputs.component_docs }} markdown: value: ${{ jobs.source.outputs.markdown }} scripts: value: ${{ jobs.source.outputs.scripts }} website_only: value: ${{ jobs.source.outputs.website_only }} install: value: ${{ jobs.source.outputs.install }} prettier: value: ${{ jobs.source.outputs.prettier }} test-yml: value: ${{ jobs.source.outputs.test-yml }} integration-yml: value: ${{ jobs.source.outputs.integration-yml }} test-make-command-yml: value: ${{ jobs.source.outputs.test-make-command-yml }} msrv-yml: value: ${{ jobs.source.outputs.msrv-yml }} cross-yml: value: ${{ jobs.source.outputs.cross-yml }} unit_mac-yml: value: ${{ jobs.source.outputs.unit_mac-yml }} unit_windows-yml: value: ${{ jobs.source.outputs.unit_windows-yml }} k8s: value: ${{ jobs.source.outputs.k8s }} amqp: value: ${{ jobs.int_tests.outputs.amqp }} appsignal: value: ${{ jobs.int_tests.outputs.appsignal }} aws: value: ${{ jobs.int_tests.outputs.aws }} axiom: value: ${{ jobs.int_tests.outputs.axiom }} azure: value: ${{ jobs.int_tests.outputs.azure }} clickhouse: value: ${{ jobs.int_tests.outputs.clickhouse }} databend: value: ${{ jobs.int_tests.outputs.databend }} datadog-agent: value: ${{ jobs.int_tests.outputs.datadog-agent }} datadog-logs: value: ${{ jobs.int_tests.outputs.datadog-logs }} datadog-metrics: value: ${{ jobs.int_tests.outputs.datadog-metrics }} datadog-traces: value: ${{ jobs.int_tests.outputs.datadog-traces }} dnstap: value: ${{ jobs.int_tests.outputs.dnstap }} docker-logs: value: ${{ jobs.int_tests.outputs.docker-logs }} doris: value: ${{ jobs.int_tests.outputs.doris }} elasticsearch: value: ${{ jobs.int_tests.outputs.elasticsearch }} eventstoredb: value: ${{ jobs.int_tests.outputs.eventstoredb }} fluent: value: ${{ jobs.int_tests.outputs.fluent }} gcp: value: ${{ jobs.int_tests.outputs.gcp }} greptimedb: value: ${{ jobs.int_tests.outputs.greptimedb }} humio: value: ${{ jobs.int_tests.outputs.humio }} http-client: value: ${{ jobs.int_tests.outputs.http-client }} influxdb: value: ${{ jobs.int_tests.outputs.influxdb }} kafka: value: ${{ jobs.int_tests.outputs.kafka }} logstash: value: ${{ jobs.int_tests.outputs.logstash }} loki: value: ${{ jobs.int_tests.outputs.loki }} mongodb: value: ${{ jobs.int_tests.outputs.mongodb }} mqtt: value: ${{ jobs.int_tests.outputs.mqtt }} nats: value: ${{ jobs.int_tests.outputs.nats }} nginx: value: ${{ jobs.int_tests.outputs.nginx }} opentelemetry: value: ${{ jobs.int_tests.outputs.opentelemetry }} postgres: value: ${{ jobs.int_tests.outputs.postgres }} prometheus: value: ${{ jobs.int_tests.outputs.prometheus }} pulsar: value: ${{ jobs.int_tests.outputs.pulsar }} redis: value: ${{ jobs.int_tests.outputs.redis }} splunk: value: ${{ jobs.int_tests.outputs.splunk }} webhdfs: value: ${{ jobs.int_tests.outputs.webhdfs }} # e2e tests e2e-datadog-logs: value: ${{ jobs.e2e_tests.outputs.datadog-logs }} e2e-datadog-metrics: value: ${{ jobs.e2e_tests.outputs.datadog-metrics }} e2e-opentelemetry-logs: value: ${{ jobs.e2e_tests.outputs.opentelemetry-logs }} e2e-opentelemetry-metrics: value: ${{ jobs.e2e_tests.outputs.opentelemetry-metrics }} int-tests-any: value: ${{ jobs.int_tests.outputs.any }} e2e-tests-any: value: ${{ jobs.e2e_tests.outputs.any }} # Workflow-level permissions - read access to repository contents permissions: contents: read # Required to checkout code env: BASE_SHA: ${{ inputs.base_ref || (github.event_name == 'merge_group' && github.event.merge_group.base_sha) || github.event.pull_request.base.sha }} HEAD_SHA: ${{ inputs.head_ref || (github.event_name == 'merge_group' && github.event.merge_group.head_sha) || github.event.pull_request.head.sha }} jobs: # Detects changes that are not specific to integration tests source: runs-on: ubuntu-24.04 timeout-minutes: 5 if: ${{ inputs.source }} outputs: source: ${{ steps.filter.outputs.source }} dependencies: ${{ steps.filter.outputs.dependencies }} deny: ${{ steps.filter.outputs.deny }} internal_events: ${{ steps.filter.outputs.internal_events }} cue: ${{ steps.filter.outputs.cue }} component_docs: ${{ steps.filter.outputs.component_docs }} markdown: ${{ steps.filter.outputs.markdown }} scripts: ${{ steps.filter.outputs.scripts }} install: ${{ steps.filter.outputs.install }} k8s: ${{ steps.filter.outputs.k8s }} website_only: ${{ steps.filter.outputs.website == 'true' && steps.filter.outputs.not_website == 'false' }} prettier: ${{ steps.filter.outputs.prettier }} test-yml: ${{ steps.filter.outputs.test-yml }} integration-yml: ${{ steps.filter.outputs.integration-yml }} test-make-command-yml: ${{ steps.filter.outputs.test-make-command-yml }} msrv-yml: ${{ steps.filter.outputs.msrv-yml }} cross-yml: ${{ steps.filter.outputs.cross-yml }} unit_mac-yml: ${{ steps.filter.outputs.unit_mac-yml }} unit_windows-yml: ${{ steps.filter.outputs.unit_windows-yml }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: filter with: base: ${{ env.BASE_SHA }} ref: ${{ env.HEAD_SHA }} filters: | source: - ".cargo/**" - "benches/**" - "lib/**" - "proto/**" - "scripts/**" - "src/**" - "tests/**" - "build.rs" - "Cargo.lock" - "Cargo.toml" - "Makefile" - "rust-toolchain.toml" - "vdev/**" - ".github/workflows/changes.yml" dependencies: - ".cargo/**" - 'Cargo.toml' - 'Cargo.lock' - 'rust-toolchain.toml' - 'Makefile' - 'scripts/cross/**' - "vdev/**" - ".github/workflows/changes.yml" deny: - '**/Cargo.toml' - 'Cargo.lock' - ".github/workflows/deny.yml" cue: - 'website/cue/**' - "vdev/**" - ".github/workflows/changes.yml" component_docs: - 'scripts/generate-component-docs.rb' - "vdev/**" - 'website/cue/**/*.cue' - 'docs/generated/**' # If changes to the VRL sha is made the combined generated cue file will change which # may cause issues - 'Cargo.lock' - ".github/workflows/changes.yml" markdown: - '**/**.md' - "vdev/**" - ".github/workflows/changes.yml" scripts: - '**/**.sh' - ".github/workflows/changes.yml" internal_events: - 'src/internal_events/**' - "vdev/**" - ".github/workflows/changes.yml" docker: - 'distribution/docker/**' - "vdev/**" - ".github/workflows/changes.yml" install: - ".github/workflows/install-sh.yml" - "distribution/install.sh" - ".github/workflows/changes.yml" k8s: - "src/sources/kubernetes_logs/**" - "lib/k8s-e2e-tests/**" - "lib/k8s-test-framework/**" - "scripts/test-e2e-kubernetes.sh" - "scripts/build-docker.sh" - "scripts/deploy-chart-test.sh" - ".github/workflows/k8s_e2e.yml" - ".github/workflows/changes.yml" website: - "website/**" not_website: - "!website/**" prettier: - "**/*.yml" - "**/*.yaml" - "**/*.js" - "**/*.ts" - "**/*.tsx" - "**/*.json" - ".prettierrc.json" - ".prettierignore" - ".github/workflows/changes.yml" test-yml: - ".github/workflows/test.yml" - ".github/workflows/changes.yml" integration-yml: - ".github/workflows/integration.yml" - ".github/workflows/changes.yml" test-make-command-yml: - ".github/workflows/test-make-command.yml" - ".github/workflows/changes.yml" msrv-yml: - ".github/workflows/msrv.yml" - ".github/workflows/changes.yml" cross-yml: - ".github/workflows/cross.yml" - ".github/workflows/changes.yml" unit_mac-yml: - ".github/workflows/unit_mac.yml" - ".github/workflows/changes.yml" unit_windows-yml: - ".github/workflows/unit_windows.yml" - ".github/workflows/changes.yml" # Detects changes that are specific to integration tests int_tests: runs-on: ubuntu-24.04 timeout-minutes: 15 if: ${{ inputs.int_tests }} permissions: contents: read outputs: amqp: ${{ steps.filter.outputs.amqp }} appsignal: ${{ steps.filter.outputs.appsignal}} aws: ${{ steps.filter.outputs.aws }} axiom: ${{ steps.filter.outputs.axiom }} azure: ${{ steps.filter.outputs.azure }} clickhouse: ${{ steps.filter.outputs.clickhouse }} databend: ${{ steps.filter.outputs.databend }} datadog-agent: ${{ steps.filter.outputs.datadog-agent }} datadog-logs: ${{ steps.filter.outputs.datadog-logs }} datadog-metrics: ${{ steps.filter.outputs.datadog-metrics }} datadog-traces: ${{ steps.filter.outputs.datadog-traces }} dnstap: ${{ steps.filter.outputs.dnstap }} docker-logs: ${{ steps.filter.outputs.docker-logs }} doris: ${{ steps.filter.outputs.doris }} elasticsearch: ${{ steps.filter.outputs.elasticsearch }} eventstoredb: ${{ steps.filter.outputs.eventstoredb }} fluent: ${{ steps.filter.outputs.fluent }} gcp: ${{ steps.filter.outputs.gcp }} greptimedb: ${{ steps.filter.outputs.greptimedb }} humio: ${{ steps.filter.outputs.humio }} http-client: ${{ steps.filter.outputs.http-client }} influxdb: ${{ steps.filter.outputs.influxdb }} kafka: ${{ steps.filter.outputs.kafka }} logstash: ${{ steps.filter.outputs.logstash }} loki: ${{ steps.filter.outputs.loki }} mongodb: ${{ steps.filter.outputs.mongodb }} mqtt: ${{ steps.filter.outputs.mqtt }} nats: ${{ steps.filter.outputs.nats }} nginx: ${{ steps.filter.outputs.nginx }} opentelemetry: ${{ steps.filter.outputs.opentelemetry }} postgres: ${{ steps.filter.outputs.postgres }} prometheus: ${{ steps.filter.outputs.prometheus }} pulsar: ${{ steps.filter.outputs.pulsar }} redis: ${{ steps.filter.outputs.redis }} splunk: ${{ steps.filter.outputs.splunk }} webhdfs: ${{ steps.filter.outputs.webhdfs }} any: ${{ steps.detect-changes.outputs.any }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/setup with: vdev: true mold: false cargo-cache: false # creates a yaml file that contains the filters for each integration, # extracted from the output of the `vdev int ci-paths` command, which # sources the paths from the tests/integration/.../config/test.yaml files - name: Create filter rules for integrations run: vdev int ci-paths > int_test_filters.yaml - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: filter with: base: ${{ env.BASE_SHA }} ref: ${{ env.HEAD_SHA }} filters: int_test_filters.yaml # This JSON hack was introduced because GitHub Actions does not support dynamic expressions in the # `if` section of a job or step. In return, we can reduce a lot of redundant job configuration in integration.yml. - name: Detect changes and generate JSON id: detect-changes run: | json=$(cat < int_tests_changes.json # Check if at least one integration test has changes any_changed=$(jq -r 'to_entries | map(select(.value == true)) | length > 0' int_tests_changes.json) echo "any=$any_changed" >> $GITHUB_OUTPUT - name: Upload JSON artifact uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: int_tests_changes path: int_tests_changes.json # Detects changes that are specific to e2e tests e2e_tests: runs-on: ubuntu-24.04 timeout-minutes: 15 if: ${{ inputs.e2e_tests }} permissions: contents: read outputs: datadog-logs: ${{ steps.filter.outputs.datadog-logs }} datadog-metrics: ${{ steps.filter.outputs.datadog-metrics }} opentelemetry-logs: ${{ steps.filter.outputs.opentelemetry-logs }} opentelemetry-metrics: ${{ steps.filter.outputs.opentelemetry-metrics }} any: ${{ steps.detect-changes.outputs.any }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/setup with: vdev: true mold: false cargo-cache: false # creates a yaml file that contains the filters for each test, # extracted from the output of the `vdev int ci-paths` command, which # sources the paths from the tests/e2e/.../test.yaml files - name: Create filter rules for e2e tests run: vdev e2e ci-paths > int_test_filters.yaml - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: filter with: base: ${{ env.BASE_SHA }} ref: ${{ env.HEAD_SHA }} filters: int_test_filters.yaml # This JSON hack was introduced because GitHub Actions does not support dynamic expressions in the # `if` section of a job or step. In return, we can reduce a lot of redundant job configuration in integration.yml. - name: Detect changes and generate JSON id: detect-changes run: | json=$(cat < e2e_tests_changes.json # Check if at least one e2e test has changes any_changed=$(jq -r 'to_entries | map(select(.value == true)) | length > 0' e2e_tests_changes.json) echo "any=$any_changed" >> $GITHUB_OUTPUT - name: Upload JSON artifact uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: e2e_tests_changes path: e2e_tests_changes.json