Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci: cache embedded postgres downloaded binaries#18477

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
johnstcn wants to merge5 commits intomain
base:main
Choose a base branch
Loading
fromcj/cache-embedded-postgres

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedJun 20, 2025
edited
Loading

Fixescoder/internal#567

Embedded Postgres downloads binaries from${REPO}/io/zonky/test/postgres/embedded-postgres-binaries-$OS-$ARCH/$VERSION/embedded-postgres-binaries-$OS-$ARCH-$VERSION.jar toCachePath:

cdr-mbp-jmqxfj0746:coder cian$ ls -l /private/tmp/nix-shell.BRKpjK/coder-test-postgres/cachetotal 29536-rw------- 1 cian wheel 30240852 Jun 20 18:09 embedded-postgres-binaries-darwin-arm64v8-16.4.0.txz

Example link for Darwin arm64:https://repo.maven.apache.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-darwin-arm64v8/16.4.0/

Making this a variable and adding it to be cached on merge to main.

@johnstcnjohnstcn self-assigned thisJun 20, 2025
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR adds support for caching downloaded Embedded Postgres binaries by introducing a--cache flag in the helper script, updating CI workflows to populate and persist that cache across runs, and providing a composite action to upload the cache onmain.

  • IntroducecachePath flag and default directory logic inmain.go
  • Update CI steps to create cache directories and pass-cache to the script
  • Addembedded-pg-cache composite action for persisting the cache

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
scripts/embedded-pg/main.goAdded--cache flag, default cache directory, andMkdirAll
.github/workflows/ci.yamlCreated cache dirs, passed-cache flag, and invoked upload
.github/actions/embedded-pg-cache/action.ymlNew composite action to save the cache viaactions/cache
Comments suppressed due to low confidence (5)

scripts/embedded-pg/main.go:17

  • The new--cache flag should be documented in the project README or script usage section to ensure users know how to leverage caching.
flag.StringVar(&cachePath, "cache", "", "Optional custom path for embedded postgres binaries")

.github/workflows/ci.yaml:500

  • [nitpick] This Windows-specific path is duplicated later; consider defining a variable for the cache path to reduce duplication and ease future updates.
            mkdir -p "C:/temp/embedded-pg-cache"

.github/workflows/ci.yaml:500

  • mkdir -p may not be available on Windows runners by default; ensure the shell supports this or use a PowerShell-native command likeNew-Item -ItemType Directory -Force.
            mkdir -p "C:/temp/embedded-pg-cache"

scripts/embedded-pg/main.go:27

  • New fallback logic forcachePath isn't covered by existing tests; consider adding an integration test to verify caching behavior is applied correctly.
if cachePath == "" {

.github/actions/embedded-pg-cache/action.yml:15

  • [nitpick] Pinning to a specific commit SHA can make upgrades harder; consider using the official version tag (actions/cache@v4) instead of a commit hash.
      uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hugodutkahugodutkahugodutka left review comments

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

flake: cli TestServer/BuiltinPostgres periodically fails to download from maven
2 participants
@johnstcn@hugodutka

[8]ページ先頭

©2009-2025 Movatter.jp