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

Commit988c893

Browse files
committed
use a temporary folder on the D: drive in Windows CI for postgres
1 parentde40386 commit988c893

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

‎.github/workflows/ci.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,12 @@ jobs:
426426
427427
if [ "${{ runner.os }}" == "Linux" ]; then
428428
make test-postgres
429+
elif [ "${{ runner.os }}" == "Windows" ]; then
430+
# Create temp dir on D: drive for Windows. The default C: drive is extremely
431+
# slow: https://github.com/actions/runner-images/issues/8755
432+
mkdir -p "D:/temp/embedded-pg"
433+
go run scripts/embedded-pg/main.go -path "D:/temp/embedded-pg"
434+
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./...
429435
else
430436
go run scripts/embedded-pg/main.go
431437
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./...

‎scripts/embedded-pg/main.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,23 @@ package main
33

44
import (
55
"database/sql"
6+
"flag"
67
"os"
78
"path/filepath"
89

910
embeddedpostgres"github.com/fergusstrange/embedded-postgres"
1011
)
1112

1213
funcmain() {
14+
varcustomPathstring
15+
flag.StringVar(&customPath,"path","","Optional custom path for postgres data directory")
16+
flag.Parse()
17+
1318
postgresPath:=filepath.Join(os.TempDir(),"coder-test-postgres")
19+
ifcustomPath!="" {
20+
postgresPath=customPath
21+
}
22+
1423
ep:=embeddedpostgres.NewDatabase(
1524
embeddedpostgres.DefaultConfig().
1625
Version(embeddedpostgres.V16).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp