Skip to content

Instantly share code, notes, and snippets.

@michelbl
Created March 21, 2018 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michelbl/facec40c926ee663a22bd2106d706815 to your computer and use it in GitHub Desktop.
Save michelbl/facec40c926ee663a22bd2106d706815 to your computer and use it in GitHub Desktop.
# See https://forums.meteor.com/t/acceptance-testing-on-circle-ci-2-0/37825/5
version: 2
jobs:
build:
working_directory: ~/app
docker:
- image: circleci/openjdk:8-jdk-browsers
environment:
# lang settings required for Meteor's Mongo
LANG: C.UTF-8
LANGUAGE: C.UTF-8
LC_ALL: C.UTF-8
LC_NUMERIC: en_US.UTF-8
METEOR_BIN_TMP_DIR: /home/circleci/build-temp/
METEOR_BIN_TMP_FILE: meteor-bin-temp
steps:
- checkout
- restore_cache:
key: build-temp-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }}
- restore_cache:
key: meteor-release-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }}
- restore_cache:
key: meteor-packages-{{ checksum ".meteor/versions" }}-{{ checksum ".circleci/config.yml" }}
- restore_cache:
key: npm-packages-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: install build
command: sudo apt-get install -y build-essential
- run:
name: restore cached meteor bin
command: |
if [ -e ~/build-temp/meteor-bin ]
then
echo "Cached Meteor bin found, restoring it"
sudo cp ~/build-temp/meteor-bin /usr/local/bin/meteor
else
echo "No cached Meteor bin found."
fi
- run:
name: install Meteor
command: |
# only install meteor if bin isn't found
command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | /bin/sh
- run:
name: check versions
command: |
echo "Meteor version:"
# this forces Meteor to download whatever release your project is using (how?)
meteor --version
which meteor
echo "Meteor node version:"
meteor node -v
echo "Meteor npm version:"
meteor npm -v
echo "Java version:"
java -version
- run:
name: install npm packages
command: meteor npm install
- run:
name: code linting
command: meteor npm run style
- run:
name: unit tests
command: meteor npm run test:unit
- run:
name: start app and run e2e tests
command: meteor npm run test:end2end-standalone
no_output_timeout: 5m
- run:
name: copy meteor bin to build cache
command: |
mkdir -p ~/build-temp
cp /usr/local/bin/meteor ~/build-temp/meteor-bin
- save_cache:
key: build-temp-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ~/build-temp
- save_cache:
key: meteor-release-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ~/.meteor
- save_cache:
key: meteor-packages-{{ checksum ".meteor/versions" }}-{{ checksum ".circleci/config.yml" }}
paths:
- .meteor/
- save_cache:
key: npm-packages-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ./node_modules/
- ~/.npm/
- store_artifacts:
path: ./tests/coverage/unit-tests/
destination: unit-tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment