Skip to content

Commit

Permalink
Merge pull request #365 from CircleCI-Public/mac
Browse files Browse the repository at this point in the history
Build on macOS
  • Loading branch information
marcomorain authored Feb 20, 2020
2 parents cc17c54 + b7c806e commit 664c4ea
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ executors:
- image: circleci/golang:1.12.15
environment:
CGO_ENABLED: 0
mac:
macos:
xcode: 11.3.1
environment:
CGO_ENABLED: 0
HOMEBREW_NO_AUTO_UPDATE: 1

commands:
build-docker-image:
Expand Down Expand Up @@ -56,13 +62,15 @@ commands:
gomod:
steps:
- restore_cache:
keys: [v1-gomod-]
keys: ["v2-gomod-{{ arch }}-"]
- run:
name: Download go module dependencies
command: go mod download
- save_cache:
key: v1-gomod-{{ checksum "go.sum" }}
paths: [/go/pkg/mod]
key: v2-gomod-{{ arch }}-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod # Linux
- ~/go/pkg/mod # macOS
# Wrap the slack/status command to only notify on failures
slack-notify-on-failure:
steps:
Expand All @@ -71,6 +79,16 @@ commands:
only_for_branch: "master"

jobs:
test_mac:
executor: mac
steps:
- checkout
- run: |
brew install [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
- gomod
- run: make test
- slack-notify-on-failure
test:
executor: go
steps:
Expand Down Expand Up @@ -217,6 +235,7 @@ workflows:
- shellcheck/check:
exclude: ./vendor/*
- test
- test_mac
- coverage
- lint
- deploy-test
Expand All @@ -229,6 +248,7 @@ workflows:
- deploy:
requires:
- test
- test_mac
- coverage
- lint
- deploy-test
Expand Down
7 changes: 7 additions & 0 deletions cmd/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ var _ = Describe("Check", func() {
"label": "short description",
"content_type": "application/zip",
"size": 1024
},
{
"id": 1,
"name": "darwin_amd64.tar.gz",
"label": "short description",
"content_type": "application/zip",
"size": 1024
}
]
}
Expand Down
7 changes: 7 additions & 0 deletions cmd/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ var _ = Describe("Update", func() {
"label": "short description",
"content_type": "application/zip",
"size": 1024
},
{
"id": 1,
"name": "darwin_amd64.tar.gz",
"label": "short description",
"content_type": "application/zip",
"size": 1024
}
]
}
Expand Down

0 comments on commit 664c4ea

Please sign in to comment.