Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[ios, macos, build] Add CircleCI iOS & macOS builds #10257

Merged
merged 3 commits into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ iproj: $(IOS_PROJ_PATH)
ios-test: $(IOS_PROJ_PATH)
set -o pipefail && $(IOS_XCODEBUILD_SIM) -scheme 'CI' test $(XCPRETTY)

.PHONY: ios-sanitize-address
ios-sanitize-address: $(IOS_PROJ_PATH)
set -o pipefail && $(IOS_XCODEBUILD_SIM) -scheme 'CI' -enableAddressSanitizer YES test $(XCPRETTY)

.PHONY: ios-sanitize-thread
ios-sanitize-thread: $(IOS_PROJ_PATH)
set -o pipefail && $(IOS_XCODEBUILD_SIM) -scheme 'CI' -enableThreadSanitizer YES test $(XCPRETTY)

.PHONY: ipackage
ipackage: $(IOS_PROJ_PATH)
FORMAT=$(FORMAT) BUILD_DEVICE=$(BUILD_DEVICE) SYMBOLS=$(SYMBOLS) \
Expand Down
105 changes: 104 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ workflows:
- linux-gcc5-debug-coverage
- linux-gcc5-release-qt4
- linux-gcc5-release-qt5
- ios-debug
#- ios-sanitize-address
- ios-sanitize-thread
- macos-debug

step-library:
- &generate-cache-key
Expand All @@ -47,7 +51,7 @@ step-library:
- &save-cache
save_cache:
key: 'v3/{{ .Environment.CIRCLE_JOB }}/{{ arch }}/{{ .Branch }}/{{ checksum ".circle-week" }}'
paths: [ "node_modules", "/root/.ccache", "mason_packages/.binaries" ]
paths: [ "node_modules", "/root/.ccache", "~/.ccache", "mason_packages/.binaries" ]
Copy link
Member

Choose a reason for hiding this comment

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

I guess we could also export CCACHE_DIR=/root/.ccache in the iOS CI jobs instead of adding this.

Copy link
Contributor Author

@friedbunny friedbunny Oct 21, 2017

Choose a reason for hiding this comment

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

Thanks, I’ll look into that. /root may not exist or may have permissions issues on macOS... 🤔

Copy link
Contributor Author

@friedbunny friedbunny Oct 23, 2017

Choose a reason for hiding this comment

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

I tried this and:

  • We’d have to export the cache path for every macOS-based job — it’s not enough to do this in a step, it has to be global for the job.
  • We’d have to create the /root/.ccache directory with sudo and give it proper permissions (or do something similar with a symlink).

I think we should just leave it as-is, saving/restoring both possible ccache paths. Caches aren’t shared across platforms and a non-existent path doesn’t break the save/restore steps.



- &reset-ccache-stats
Expand Down Expand Up @@ -97,6 +101,28 @@ step-library:
run:
name: Build qt-test
command: make qt-test
- &build-ios-test
run:
name: Build ios-test
command: make ios-test
- &build-macos-test
run:
name: Build and run macOS tests
command: make run-test


- &check-public-symbols
run:
name: Check public symbols
command: make check-public-symbols


- &install-macos-dependencies
run:
name: Install dependencies
command: |
brew install cmake
brew install ccache


- &run-node-tests
Expand Down Expand Up @@ -589,3 +615,80 @@ jobs:
command: |
xvfb-run --server-args="-screen 0 1024x768x24" \
scripts/valgrind.sh build/qt-linux-x86_64/Release/mbgl-test --gtest_filter=-*.Load --gtest_filter=-Memory.Vector

# ------------------------------------------------------------------------------
ios-debug:
macos:
xcode: "9.0"
environment:
BUILDTYPE: Debug
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- checkout
- *install-macos-dependencies
- *generate-cache-key
- *restore-cache
- *reset-ccache-stats
- *build-ios-test
- *check-public-symbols
- *show-ccache-stats
- *save-cache

# ------------------------------------------------------------------------------
ios-sanitize-address:
macos:
xcode: "9.0"
environment:
BUILDTYPE: Debug
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- checkout
- *install-macos-dependencies
- *generate-cache-key
- *restore-cache
- *reset-ccache-stats
- run:
name: Build and run SDK unit tests with address sanitizer
command: make ios-sanitize-address
- *show-ccache-stats
- *save-cache

# ------------------------------------------------------------------------------
ios-sanitize-thread:
macos:
xcode: "9.0"
environment:
BUILDTYPE: Debug
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- checkout
- *install-macos-dependencies
- *generate-cache-key
- *restore-cache
- *reset-ccache-stats
- run:
name: Build and run SDK unit tests with thread sanitizer
command: make ios-sanitize-thread
- *show-ccache-stats
- *save-cache

# ------------------------------------------------------------------------------
macos-debug:
macos:
xcode: "9.0"
environment:
BUILDTYPE: Debug
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- checkout
- *install-macos-dependencies
- *generate-cache-key
- *restore-cache
- *reset-ccache-stats
- *build-macos-test
- *check-public-symbols
- *show-ccache-stats
- *save-cache
- store_artifacts:
path: test/fixtures
destination: test/fixtures
43 changes: 2 additions & 41 deletions platform/ios/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,9 @@ workflows:
primary:
steps:
- script:
title: Install Dependencies
inputs:
- content: |-
#!/bin/bash
set -eu -o pipefail
brew install cmake
- is_debug: 'yes'
- script:
title: Generate Workspace
title: Skip Workflow
inputs:
- content: |-
#!/bin/bash
set -eu -o pipefail
export BUILDTYPE=Debug
make iproj
- is_debug: 'yes'
- xcode-test:
title: Run SDK Unit Tests
inputs:
- project_path: platform/ios/ios.xcworkspace
- scheme: CI
- deploy-to-bitrise-io:
title: Deploy to Bitrise.io
inputs:
- notify_user_groups: none
- slack:
title: Post to Slack
inputs:
- webhook_url: "$SLACK_HOOK_URL"
- channel: "#gl-bots"
- from_username: 'Bitrise iOS'
- from_username_on_error: 'Bitrise iOS'
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
by ${GIT_CLONE_COMMIT_COMMITER_NAME}
passed'
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
by ${GIT_CLONE_COMMIT_COMMITER_NAME}
failed'
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
- icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
- content: echo "This workflow is obsolete — see CircleCi."
nightly-release:
steps:
- script:
Expand Down
34 changes: 2 additions & 32 deletions platform/macos/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,9 @@ workflows:
primary:
steps:
- script:
title: Build
inputs:
- content: |-
#!/bin/bash
set -eu -o pipefail
brew install cmake
gem install xcpretty --no-rdoc --no-ri
export BUILDTYPE=Debug
export XCPRETTY="| tee ${BITRISE_DEPLOY_DIR}/raw-xcodebuild-output.txt | xcpretty --color --report html --output ${BITRISE_DEPLOY_DIR}/xcode-test-results.html"
make run-test
- deploy-to-bitrise-io:
title: Deploy to Bitrise.io
inputs:
- deploy_path: "test/fixtures"
- notify_user_groups: none
- is_compress: 'true'
- slack:
title: Post to Slack
title: Skip Workflow
inputs:
- webhook_url: "$SLACK_HOOK_URL"
- channel: "#gl-bots"
- from_username: 'Bitrise macOS'
- from_username_on_error: 'Bitrise macOS'
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
by ${GIT_CLONE_COMMIT_COMMITER_NAME}
passed'
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
by ${GIT_CLONE_COMMIT_COMMITER_NAME}
failed'
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
- icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
- content: echo "This workflow is obsolete — see CircleCi."
nightly-release:
steps:
- script:
Expand Down