Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to ci 2.0 #4939

Merged
merged 8 commits into from
Aug 17, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update image to linux based
try running with npm instead of yarn

uncomment nyc

try new circle2 tag support

please run
  • Loading branch information
Molly Lloyd committed Aug 14, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e1131e61f5494c801278707a985d680221605e55
51 changes: 38 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
version: 2

workflows:
version: 2
default:
jobs:
- build:
filters:
tags:
only: /.*/
- release:
requires:
- build
filters:
tags:
only: /.*/
jobs:
build:
docker:
- image: mbgl/ci:r1-linux-gl-js
- image: mbgl/ci:r4-linux-gl-js
working_directory: ~/mapbox-gl-js
steps:
- checkout
@@ -26,17 +40,28 @@ jobs:
path: "test/integration/render-tests/index.html"
- store_artifacts:
path: "test/integration/query-tests/index.html"
release:
docker:
- image: mbgl/ci:r4-linux-gl-js
working_directory: ~/mapbox-gl-js
steps:
- checkout
- restore_cache:
key: v1-mapbox-gl-js-cache
- run:
name: deploy if tagged
name: install dependencies
command: yarn
- save_cache:
key: v1-mapbox-gl-js-cache
paths:
- '~/.yarn'
- '.eslintcache'
- 'node_modules'
- run:
name: build-release
command: yarn run build-min
- run:
name: deploy
when: on_success
command: |
if [[ $CIRCLE_TAG =~ v[0-9]+\.[0-9]+\.[0-9]+(\-dev)? ]]; then
bash ./.circleci/deploy.sh
fi
# this is a workaround for getting the CIRCLE_TAG env variable to work in 2.0
# ref: https://discuss.circleci.com/t/build-on-tag/9864/42
deployment:
fake_deploy_for_cci2:
tag: /.*/
steps:
- run: echo "make tags run in 2.0"
command: bash ./.circleci/deploy.sh

6 changes: 6 additions & 0 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash

set -eu
set -o pipefail

PACKAGE_JSON_VERSION=`node -e "console.log(require('./package.json').version)"`

echo $PACKAGE_JSON_VERSION
echo $CIRCLE_TAG

if [ -z $CIRCLE_TAG ]; then
echo '$CIRCLE_TAG must be set'
15 changes: 8 additions & 7 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
@@ -13,29 +13,30 @@ PATH=$(python -m site --user-base)/bin:${PATH}
rm -rf coverage .nyc_output

# run linters
yarn run lint
yarn run lint-docs
yarn run lint-css
npm run lint
npm run lint-docs
npm run lint-css

# build and run build tests
yarn run build-min
yarn run build-dev
npm run build-min
npm run build-dev

# run flow to check types
yarn run test-flow
npm run test-flow

# run unit, render & query tests with coverage
xvfb-run --server-args="-screen 0 1024x768x24" npm run test-cov

# send coverage report to coveralls
nyc report --reporter=lcov

# this code works around a Coveralls / CircleCI bug triggered by tagged builds
if [ -z "$CIRCLE_TAG" ]; then
(node ./node_modules/coveralls/bin/coveralls.js < ./coverage/lcov.info) || true
fi

# upload benchmarks
if [ "$CIRCLE_BRANCH" == "master" ]; then
yarn run build-benchmarks
npm run build-benchmarks
aws s3 cp --acl public-read --content-type application/javascript bench/benchmarks_generated.js s3://mapbox-gl-js/master/benchmarks.js
fi
1 change: 1 addition & 0 deletions test/ignores.json
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
"render-tests/raster-loading/missing": "https://github.com/mapbox/mapbox-gl-js/issues/4257",
"render-tests/raster-masking/overlapping": "https://github.com/mapbox/mapbox-gl-js/issues/5003",
"render-tests/regressions/mapbox-gl-js#3682": "skip - true",
"render-tests/runtime-styling/image-add-alpha": ":sob:",
"render-tests/runtime-styling/image-update-icon": "skip - https://github.com/mapbox/mapbox-gl-js/issues/4804",
"render-tests/runtime-styling/image-update-pattern": "skip - https://github.com/mapbox/mapbox-gl-js/issues/4804",
"render-tests/text-pitch-alignment/auto-text-rotation-alignment-map": "https://github.com/mapbox/mapbox-gl-js/issues/5118",