Skip to content
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

Only fetch submodules in workflows if we actually need them to build #6888

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
32 changes: 22 additions & 10 deletions .github/workflows.src/tests.inc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
fetch-depth: 0
submodules: false

- uses: actions/checkout@v4
with:
fetch-depth: 50
submodules: true

- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
Expand Down Expand Up @@ -108,9 +103,20 @@
uses: actions/cache@v4
id: libpg-query-cache
with:
path: edb/pgsql/parser/libpg_query/libpg_query.a
path: build/libpg_query/libpg_query.a
key: edb-libpg_query-v1-${{ env.LIBPG_QUERY_GIT_REV }}

- name: Fetch submodules
if: |
steps.ext-cache.outputs.cache-hit != 'true' ||
steps.postgres-cache.outputs.cache-hit != 'true' ||
steps.libpg-query-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
fetch-depth: 50
submodules: true
clean: false

# Install system dependencies for building

- name: Install system deps
Expand Down Expand Up @@ -184,11 +190,17 @@
# Build libpg_query

- name: Build libpg_query
if: |
steps.libpg-query-cache.outputs.cache-hit != 'true' &&
steps.ext-cache.outputs.cache-hit != 'true'
if: steps.ext-cache.outputs.cache-hit != 'true'
env:
CACHE_HIT: ${{ steps.libpg-query-cache.outputs.cache-hit }}
run: |
python setup.py build_libpg_query
if [[ "$CACHE_HIT" != "true" ]]; then
python setup.py build_libpg_query
mkdir -p build/libpg_query
cp edb/pgsql/parser/libpg_query/libpg_query.a build/libpg_query/
else
cp build/libpg_query/libpg_query.a edb/pgsql/parser/libpg_query/
fi

# Build extensions

Expand Down
37 changes: 22 additions & 15 deletions .github/workflows/tests-ha.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 22 additions & 35 deletions .github/workflows/tests-managed-pg.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 22 additions & 15 deletions .github/workflows/tests-patches.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 22 additions & 15 deletions .github/workflows/tests-pg-versions.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading