Skip to content

Commit c0fbd81

Browse files
Apple silicon tests (#116)
* Try apple build. * Skip v13 and below for arm64 darwin.
1 parent b632dc8 commit c0fbd81

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

.circleci/config.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ version: 2.1
22
executors:
33
linux-arm64:
44
machine:
5-
image: ubuntu-2004:202104-01
5+
image: ubuntu-2004:2022.04.1
66
resource_class: arm.medium
77
working_directory: /home/circleci/go/src/github.com/fergusstrange/embedded-postgres
8-
8+
apple-m1: &macos-executor
9+
resource_class: macos.m1.medium.gen1
10+
macos:
11+
xcode: "14.2.0"
12+
orbs:
13+
go: circleci/[email protected]
914
jobs:
1015
platform_test:
1116
parameters:
@@ -14,14 +19,15 @@ jobs:
1419
executor: << parameters.executor >>
1520
steps:
1621
- checkout
17-
- restore_cache:
18-
keys:
19-
- embedded-postgres-{{ checksum "/home/circleci/go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
22+
- when:
23+
condition:
24+
equal: [ *macos-executor, << parameters.executor >> ]
25+
steps:
26+
- go/install
27+
- go/load-cache
28+
- go/mod-download
29+
- go/save-cache
2030
- run: cd platform-test && go mod download && go test -v -race ./...
21-
- save_cache:
22-
key: embedded-postgres-{{ checksum "/home/circleci/go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
23-
paths:
24-
- /home/circleci/go/pkg
2531

2632
workflows:
2733
version: 2
@@ -30,4 +36,6 @@ workflows:
3036
- platform_test:
3137
matrix:
3238
parameters:
33-
executor: [ linux-arm64 ]
39+
executor:
40+
- linux-arm64
41+
- apple-m1

platform-test/platform_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"os"
77
"path/filepath"
8+
"runtime"
89
"strings"
910
"testing"
1011

@@ -15,11 +16,15 @@ func Test_AllMajorVersions(t *testing.T) {
1516
allVersions := []embeddedpostgres.PostgresVersion{
1617
embeddedpostgres.V15,
1718
embeddedpostgres.V14,
18-
embeddedpostgres.V13,
19-
embeddedpostgres.V12,
20-
embeddedpostgres.V11,
21-
embeddedpostgres.V10,
22-
embeddedpostgres.V9,
19+
}
20+
21+
if runtime.GOOS != "darwin" && runtime.GOARCH == "arm64" {
22+
allVersions = append(allVersions,
23+
embeddedpostgres.V13,
24+
embeddedpostgres.V12,
25+
embeddedpostgres.V11,
26+
embeddedpostgres.V10,
27+
embeddedpostgres.V9)
2328
}
2429

2530
tempExtractLocation, err := os.MkdirTemp("", "embedded_postgres_tests")

0 commit comments

Comments
 (0)