diff --git a/.github/bin/build-matrix-from-impacted.py b/.github/bin/build-matrix-from-impacted.py index f915e4a06eee..a9afedb6dc02 100755 --- a/.github/bin/build-matrix-from-impacted.py +++ b/.github/bin/build-matrix-from-impacted.py @@ -58,7 +58,7 @@ def build(matrix_file, impacted_file, output_file): modules = item.get("modules", []) if isinstance(modules, str): modules = [modules] - if not any(module in impacted for module in modules): + if impacted and not any(module in impacted for module in modules): logging.info("Excluding matrix section: %s", item) continue include.append( @@ -68,8 +68,7 @@ def build(matrix_file, impacted_file, output_file): "profile": item.get("profile", ""), } ) - if include: - matrix["include"] = include + matrix["include"] = include json.dump(matrix, output_file) output_file.write("\n") diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d020dcddd8a..7a2169ed4569 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -370,6 +370,8 @@ jobs: $RETRY $MAVEN validate ${MAVEN_FAST_INSTALL} -P disable-check-spi-dependencies -pl '!:trino-docs,!:trino-server,!:trino-server-rpm' - id: set-matrix run: | + # GIB doesn't run on master, so make sure the file always exist + touch gib-impacted.log cat < .github/test-matrix.yaml include: - { modules: core/trino-main } @@ -401,7 +403,7 @@ jobs: - { modules: [ client/trino-jdbc, plugin/trino-base-jdbc, plugin/trino-thrift, plugin/trino-memory ] } - { modules: plugin/trino-bigquery } EOF - ./.github/bin/build-matrix-from-impacted.py -v -m .github/test-matrix.yaml -o matrix.json + ./.github/bin/build-matrix-from-impacted.py -v -i gib-impacted.log -m .github/test-matrix.yaml -o matrix.json echo "Matrix: $(jq '.' matrix.json)" echo "::set-output name=matrix::$(jq -c '.' matrix.json)"