File tree Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 11version : 2.1
22executors :
3- linux :
4- machine :
5- image : ubuntu-2004:202104-01
6- working_directory : /go/src/github.com/fergusstrange/embedded-postgres
73 linux-arm64 :
84 machine :
95 image : ubuntu-2004:202104-01
106 resource_class : arm.medium
11- working_directory : /go/src/github.com/fergusstrange/embedded-postgres
12- osx :
13- macos :
14- xcode : 11.4
15- working_directory : /go/src/github.com/fergusstrange/embedded-postgres
7+ working_directory : /home/circleci/go/src/github.com/fergusstrange/embedded-postgres
168
179jobs :
1810 platform_test :
1911 parameters :
20- os :
12+ executor :
2113 type : executor
2214 executor : << parameters.executor >>
2315 steps :
2416 - checkout
2517 - restore_cache :
2618 keys :
27- - embedded-postgres-{{ checksum "/go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
19+ - embedded-postgres-{{ checksum "/home/circleci/ go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
2820 - run : cd platform-test && go test -v -race ./...
2921 - save_cache :
30- key : embedded-postgres-{{ checksum "/go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
22+ key : embedded-postgres-{{ checksum "/home/circleci/ go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
3123 paths :
32- - /go/pkg
24+ - /home/circleci/ go/pkg
3325
3426workflows :
3527 version : 2
@@ -38,4 +30,4 @@ workflows:
3830 - platform_test :
3931 matrix :
4032 parameters :
41- executor : [ linux, linux -arm64, osx ]
33+ executor : [ linux-arm64 ]
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package embeddedpostgres
22
33import (
44 "os"
5+ "os/exec"
56 "runtime"
7+ "strings"
68)
79
810// VersionStrategy provides a strategy that can be used to determine which version of Postgres should be used based on
@@ -14,8 +16,24 @@ func defaultVersionStrategy(config Config) VersionStrategy {
1416 goos := runtime .GOOS
1517 arch := runtime .GOARCH
1618
17- // use alpine specific build
1819 if goos == "linux" {
20+ // the zonkyio/embedded-postgres-binaries project produces
21+ // arm binaries with the following name schema:
22+ // 32bit: arm32v6 / arm32v7
23+ // 64bit (aarch64): arm64v8
24+ if arch == "arm64" {
25+ arch += "v8"
26+ } else if arch == "arm" {
27+ if out , err := exec .Command ("uname" , "-m" ).Output (); err == nil {
28+ s := string (out )
29+ if strings .HasPrefix (s , "armv7" ) {
30+ arch += "32v7"
31+ } else if strings .HasPrefix (s , "armv6" ) {
32+ arch += "32v6"
33+ }
34+ }
35+ }
36+ // check alpine specific build
1937 if _ , err := os .Stat ("/etc/alpine-release" ); err == nil {
2038 arch += "-alpine"
2139 }
You can’t perform that action at this time.
0 commit comments