From 664cdec0947cab2ab34a86b792989dc7f00fe6c9 Mon Sep 17 00:00:00 2001 From: Fedor Dikarev Date: Mon, 6 Jan 2025 08:29:09 +0100 Subject: [PATCH] rewrite file filter --- .github/file-filters.yaml | 40 ++----------------------- .github/workflows/build-macos.yml | 7 ++++- .github/workflows/neon_extra_builds.yml | 2 ++ 3 files changed, 10 insertions(+), 39 deletions(-) diff --git a/.github/file-filters.yaml b/.github/file-filters.yaml index 1b2e0b782227..ca6b49e6a684 100644 --- a/.github/file-filters.yaml +++ b/.github/file-filters.yaml @@ -1,45 +1,9 @@ -# From Cargo.toml -Cargo_toml_members: &Cargo_toml_members [ - "compute_tools", - "control_plane", - "control_plane/storcon_cli", - "pageserver", - "pageserver/compaction", - "pageserver/ctl", - "pageserver/client", - "pageserver/pagebench", - "proxy", - "safekeeper", - "storage_broker", - "storage_controller", - "storage_controller/client", - "storage_scrubber", - "workspace_hack", - "libs/compute_api", - "libs/pageserver_api", - "libs/postgres_ffi", - "libs/safekeeper_api", - "libs/desim", - "libs/utils", - "libs/consumption_metrics", - "libs/postgres_backend", - "libs/pq_proto", - "libs/tenant_size_model", - "libs/metrics", - "libs/postgres_connection", - "libs/remote_storage", - "libs/tracing-utils", - "libs/postgres_ffi/wal_craft", - "libs/vm_monitor", - "libs/walproposer", - "libs/wal_decoder", - "libs/postgres_initdb", -] +rust_code: ['**/*.rs', '**/Cargo.toml', '**/Cargo.lock'] v14: ['vendor/postgres-v14/**', 'Makefile', 'pgxn/**'] v15: ['vendor/postgres-v15/**', 'Makefile', 'pgxn/**'] v16: ['vendor/postgres-v16/**', 'Makefile', 'pgxn/**'] -v17: ['vendor/postgres-v17/**', 'Makefile', 'pgxn/**', *Cargo_toml_members] +v17: ['vendor/postgres-v17/**', 'Makefile', 'pgxn/**'] rebuild_neon_extra: - .github/workflows/neon_extra_builds.yml diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 61653d19b8af..11705b56e00b 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -8,6 +8,11 @@ on: type: string default: '[]' required: false + rebuild_rust_code: + description: "Rebuild Rust code" + type: boolean + default: false + required: false rebuild_everything: description: "If true, rebuild for all versions" type: boolean @@ -147,7 +152,7 @@ jobs: cargo-build: if: | - (inputs.pg_versions != '[]' || inputs.rebuild_everything) && ( + (inputs.pg_versions != '[]' || inputs.rust_code || inputs.rebuild_everything) && ( contains(github.event.pull_request.labels.*.name, 'run-extra-build-macos') || contains(github.event.pull_request.labels.*.name, 'run-extra-build-*') || github.ref_name == 'main' diff --git a/.github/workflows/neon_extra_builds.yml b/.github/workflows/neon_extra_builds.yml index 7bbe33dd0022..2e5693faca80 100644 --- a/.github/workflows/neon_extra_builds.yml +++ b/.github/workflows/neon_extra_builds.yml @@ -38,6 +38,7 @@ jobs: outputs: v17: ${{ steps.files_changed.outputs.v17 }} postgres_changes: ${{ steps.postgres_changes.outputs.changes }} + rebuild_rust_code: ${{ steps.files_changed.outputs.rust_code }} rebuild_everything: ${{ steps.files_changed.outputs.rebuild_neon_extra || steps.files_changed.outputs.rebuild_macos }} steps: @@ -70,6 +71,7 @@ jobs: uses: ./.github/workflows/build-macos.yml with: pg_versions: ${{ needs.files-changed.outputs.postgres_changes }} + rebuild_rust_code: ${{ needs.files-changed.outputs.rust_code }} rebuild_everything: ${{ fromJson(needs.files-changed.outputs.rebuild_everything) }} gather-rust-build-stats: