version: 2

# ------------------------------------------------------------------------------
# mbgl/ci:{version}-rtl-text is built from the Dockerfile at
# https://github.com/mapbox/mbgl-ci-images/rtl-text
# The base image sets up the build environment and has a (probably stale)
# clone of https://github.com/mapbox/mapbox-gl-rtl-text
# At build time, we sync the latest version of the repo and update npm
# packages.
jobs:
    build:
        docker:
          - image: mbgl/ci:r2-rtl-text
        working_directory: /src
        steps:
          - checkout
          - run:
              name: Update NPM packages
              command: npm install
          - run:
              name: Build Emscripten-based ICU; Build mapbox-gl-rtl-text.js.min
              command: ./build.sh
          - run:
              name: Test Arabic
              command: npm test
          - store_artifacts:
              path: mapbox-gl-rtl-text.js.min
              destination: .
