From 393545512701f7708c05bfc4dfec827a14ae6ac7 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Thu, 10 Aug 2017 16:32:09 -0700 Subject: [PATCH] Switch to CircleCI 2.0 Switch to a CircleCI 2.0 workflow that splits the job up a little bit, in preparation for when the Atom script supports running the beta channel on CircleCI this will allow it to run both in parallel. --- .circleci/config.yml | 77 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 14 -------- 2 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..6e1cbd5 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,77 @@ +version: 2 +jobs: + checkout_code: + working_directory: ~/linter-pycodestyle + docker: + - image: circleci/python:latest + steps: + - checkout + - run: + name: Download Atom test script + command: curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh + - run: + name: Make Atom script executable + command: chmod u+x build-package.sh + # Restore node_modules from the last build + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # Save project state for next steps + - run: + name: Save build SHA1 to a file + command: echo $CIRCLE_SHA1 > .circle-sha + - save_cache: + key: v1-repo-{{ checksum ".circle-sha" }} + paths: + - ~/linter-pycodestyle + + stable: + working_directory: ~/linter-pycodestyle + docker: + - image: circleci/python:latest + environment: + CIRCLE_BUILD_IMAGE: ubuntu + ATOM_CHANNEL: stable + DISPLAY: :99 + steps: + # Restore project state + - run: + name: Save build SHA1 to a file + command: echo $CIRCLE_SHA1 > .circle-sha + - restore_cache: + keys: + - v1-repo-{{ checksum ".circle-sha" }} + - run: + name: Update APT + command: sudo apt-get update + # Install some pre-requisite packages and missing dependencies from the atom package + - run: + name: Atom Prerequisites + command: sudo apt-get --assume-yes --quiet --no-install-suggests --no-install-recommends install sudo xvfb libxss1 libasound2 + # Fire up a VFB to run Atom in + - run: + name: Create VFB for Atom to run in + command: sudo /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 + - run: + name: Install pycodestyle + command: sudo pip install pycodestyle + - run: + name: pycodestyle Version + command: pycodestyle --version + - run: + name: Atom test + command: ./build-package.sh + # Cache node_modules + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + +workflows: + version: 2 + stable: + jobs: + - checkout_code + - stable: + requires: + - checkout_code diff --git a/circle.yml b/circle.yml deleted file mode 100644 index e4f6d39..0000000 --- a/circle.yml +++ /dev/null @@ -1,14 +0,0 @@ -machine: - python: - version: 3.6.2 - -dependencies: - override: - - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh - - chmod u+x build-package.sh - - pip install pycodestyle - -test: - override: - - pycodestyle --version - - ./build-package.sh