diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..5c4ac05 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,121 @@ +version: 2 + +defaults: &defaults + working_directory: /tmp/project + docker: + - image: arcanemagus/atom-docker-ci:stable + steps: + # Restore project state + - attach_workspace: + at: /tmp + - run: + name: Install Node.js 10 + command: | + sudo apt-get update && \ + sudo apt-get install --assume-yes --quiet --no-install-suggests \ + --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \ + sudo apt-get update && \ + sudo apt-get install --assume-yes --quiet --no-install-suggests \ + --no-install-recommends nodejs + - run: + name: Node.js version + command: node --version + - run: + name: Install sass-lint + command: sudo npm install -g sass-lint + - run: + name: Sass Lint version + command: sass-lint --version + - run: + name: Create VFB for Atom to run in + command: /usr/local/bin/xvfb_start + - run: + name: Atom version + command: ${ATOM_SCRIPT_PATH} --version + - run: + name: APM version + command: ${APM_SCRIPT_PATH} --version + - run: + name: Cleaning package + command: ${APM_SCRIPT_PATH} clean + - run: + name: Package APM package dependencies + command: | + if [ -n "${APM_TEST_PACKAGES}" ]; then + for pack in ${APM_TEST_PACKAGES}; do + ${APM_SCRIPT_PATH} install "${pack}" + done + fi; + - run: + name: Package dependencies + command: ${APM_SCRIPT_PATH} install + - run: + name: Package specs + command: ${ATOM_SCRIPT_PATH} --test spec + # Cache node_modules + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + +jobs: + checkout_code: + <<: *defaults + docker: + - image: circleci/node:latest + steps: + - checkout + # Restore node_modules from the last build + - restore_cache: + keys: + # Get latest cache for this package.json + - v1-dependencies-{{ checksum "package.json" }} + # Fallback to the last available cache + - v1-dependencies + # Save project state for next steps + - persist_to_workspace: + root: /tmp + paths: + - project + lint: + <<: *defaults + docker: + - image: circleci/node:latest + steps: + # Restore project state + - attach_workspace: + at: /tmp + - run: + name: Node.js Version + command: node --version + - run: + name: NPM Version + command: npm --version + - run: + name: Install any remaining dependencies + command: npm install + - run: + name: Lint code + command: npm run lint + stable: + <<: *defaults + beta: + <<: *defaults + docker: + - image: arcanemagus/atom-docker-ci:beta + +workflows: + version: 2 + test_package: + jobs: + - checkout_code + - lint: + requires: + - checkout_code + - stable: + requires: + - lint + - beta: + requires: + - lint diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 550fe5f..0000000 --- a/circle.yml +++ /dev/null @@ -1,13 +0,0 @@ -test: - override: - - curl -s https://raw.githubusercontent.com/Arcanemagus/ci/atomlinter/build-package.sh | sh - -dependencies: - override: - - npm install -g sass-lint - -machine: - node: - version: 6 - environment: - ATOM_LINT_WITH_BUNDLED_NODE: "false"