diff --git a/.circleci/bootstrap.sh b/.circleci/bootstrap.sh new file mode 100755 index 0000000..d840500 --- /dev/null +++ b/.circleci/bootstrap.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +echo "setting up node to use latest lts" + +export NVS_HOME="$HOME/.nvs" +git clone --depth=1 https://github.com/jasongin/nvs "$NVS_HOME" +. "$NVS_HOME/nvs.sh" install +nvs add lts +nvs link lts +nvs use default +echo "using node $(node --version)" + +# Install latest yarn version +npm install -g yarn + +echo "using yarn $(yarn --version)" + +# Run yarn +yarn diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..5748879 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,28 @@ +version: 2 + +jobs: + test: + macos: + xcode: "9.0" + steps: + - checkout + - restore_cache: + keys: + - package-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} + - package- # Fallback for the latest package.json cache + - run: + name: configure-yarn + command: .circleci/bootstrap.sh + - save_cache: + key: package-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} + paths: + - node_modules + - run: + name: test + command: .circleci/test.sh + +workflows: + version: 2 + test: + jobs: + - test diff --git a/.circleci/test.sh b/.circleci/test.sh new file mode 100755 index 0000000..9c9e6b6 --- /dev/null +++ b/.circleci/test.sh @@ -0,0 +1,11 @@ +#1/usr/bin/env bash + +export NVS_HOME="$HOME/.nvs" +. "$NVS_HOME/nvs.sh" install + +nvs link lts +nvs use default + +set -e -x + +yarn run asset-compile diff --git a/circle.yml b/circle.yml deleted file mode 100644 index e4aae28..0000000 --- a/circle.yml +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: - override: - - export NVS_HOME="$HOME/.nvs" && git clone https://github.com/jasongin/nvs "$NVS_HOME" && . "$NVS_HOME/nvs.sh" install - - nvs add lts && nvs link lts && nvs use default - - npm i yarn -g - - yarn -test: - override: - - yarn run asset-compile diff --git a/package.json b/package.json index 5024061..538434f 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "asset-compile": "ts-node tasks/asset-compile", "test": "mocha", - "fmt": "prettier --parser typescript --no-semi --print-width 100 --single-quote --write \"{src,plugins,tasks}/**/*.ts\"", + "fmt": "prettier --parser typescript --no-semi --print-width 100 --single-quote --write \"{src,plugins,tasks}/**/*.ts\"", "prepare": "npm run build", "prepublishOnly": "npm test", "prebuild": "rimraf lib && npm run fmt",