diff --git a/.circleci/config.yml b/.circleci/config.yml index 922f8764494..2dccff9001a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,26 @@ version: 2 +workflows: + version: 2 + default: + jobs: + - build: + filters: + tags: + only: /.*/ + - release: + requires: + - build + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ + 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 +43,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: 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 if tagged + 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 + diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index 4fe201e6bb3..138d813da00 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -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' diff --git a/.circleci/test.sh b/.circleci/test.sh index d0d08e82e34..acbddf26bf2 100755 --- a/.circleci/test.sh +++ b/.circleci/test.sh @@ -13,22 +13,23 @@ 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 @@ -36,6 +37,6 @@ 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 diff --git a/test/ignores.json b/test/ignores.json index 5d4569cb5dc..3547a90addb 100644 --- a/test/ignores.json +++ b/test/ignores.json @@ -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",