From 6543d47169749f6cd75c176392bceeff69ce5ff4 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Fri, 22 Mar 2019 12:43:14 -0400 Subject: [PATCH 1/3] backport circleci testing --- .circleci/config.yml | 212 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000000..01b3105991a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,212 @@ +# Python CircleCI 2.0 configuration file +version: 2 +variables: + restore_repo_cache: &restore_repo_cache + restore_cache: + keys: + - v1-repo-{{ .Environment.CIRCLE_SHA1 }} + restore_yarn_cache: &restore_yarn_cache + restore_cache: + keys: + - v1-repo-{{ .Environment.CIRCLE_SHA1 }} + - yarn-packages-{{ checksum "client/yarn.lock" }} + save_yarn_cache: &save_yarn_cache + save_cache: + key: yarn-packages-{{ checksum "client/yarn.lock" }} + paths: + - ~/.cache/yarn + install_tox: &install_tox + run: sudo pip install tox + set_workdir: &set_workdir + working_directory: ~/repo + requires_get_code: &requires_get_code + requires: + - get_code +jobs: + get_code: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + # Replace standard code checkout with shallow clone to speed things up. + - run: + name: Checkout code + command: |- + # Add github.com to known hosts + mkdir -p ~/.ssh + echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== + ' >> ~/.ssh/known_hosts + + # Add the user ssh key and set correct perms + (umask 077; touch ~/.ssh/id_rsa) + chmod 0600 ~/.ssh/id_rsa + echo "$CHECKOUT_KEY" > ~/.ssh/id_rsa + + # Use git+ssh instead of https + git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true + git config --global gc.auto 0 || true + + # Shallow clone + git clone --depth=1 "${CIRCLE_REPOSITORY_URL}" . + + if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then + # Update PR refs for testing. + FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head" + FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge" + + # Retrieve the refs + git fetch --force origin ${FETCH_REFS} + + # Checkout PR merge ref. + git checkout -f "pr/${CIRCLE_PR_NUMBER}/merge" + + # Test for *some* merge conflicts. + git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null + else + if [ -n "$CIRCLE_TAG" ]; then + git fetch --depth=1 --force origin "refs/tags/${CIRCLE_TAG}" + else + git fetch --depth=1 --force origin "$CIRCLE_BRANCH:remotes/origin/$CIRCLE_BRANCH" + fi + if [ -n "$CIRCLE_TAG" ]; then + git reset --hard "$CIRCLE_SHA1" + git checkout "$CIRCLE_TAG" + elif [ -n "$CIRCLE_BRANCH" ]; then + git reset --hard "$CIRCLE_SHA1" + git checkout -B "$CIRCLE_BRANCH" + fi + git reset --hard "${CIRCLE_SHA1}" + fi + - save_cache: + key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo + py27_lint: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + - *restore_repo_cache + - *install_tox + - run: tox -e py27-lint + py27_unit: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + - *restore_repo_cache + - *install_tox + - run: tox -e py27-unit + py27_docstring: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + - *restore_repo_cache + - *install_tox + - run: tox -e py27-lint_docstring_include_list + py27_first_startup: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + - *restore_repo_cache + - run: sh scripts/common_startup.sh + - run: wget -q https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0127.sqlite + - run: mv db_gx_rev_0127.sqlite database/universe.sqlite + - run: sh manage_db.sh -c ./config/galaxy.yml.sample upgrade + - *install_tox + - run: tox -e py27-first_startup + py35_lint: + docker: + - image: circleci/python:3.5 + <<: *set_workdir + steps: + - *restore_repo_cache + - *install_tox + - run: tox -e py35-lint + py35_unit: + docker: + - image: circleci/python:3.5 + <<: *set_workdir + steps: + - *restore_repo_cache + - *install_tox + - run: tox -e py35-unit + py35_first_startup: + docker: + - image: circleci/python:3.5 + <<: *set_workdir + steps: + - *restore_repo_cache + - *install_tox + - run: sudo apt-get update + # For uwsgi + - run: sudo apt-get install -y libpython3.5-dev + - run: tox -e py35-first_startup + validate_test_tools: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + - *restore_repo_cache + - run: sudo apt-get update + - run: sudo apt-get install -y libxml2-utils + - *install_tox + - run: tox -e validate_test_tools + check_py3_compatibility: + docker: + - image: circleci/python:2.7.15 + <<: *set_workdir + steps: + - *restore_repo_cache + - run: sudo apt-get update + - run: sudo apt-get install -y ack-grep + - *install_tox + - run: tox -e check_py3_compatibility + js_unit: + docker: + - image: circleci/node:10-browsers + <<: *set_workdir + steps: + - *restore_yarn_cache + - run: cd client && yarn install --frozen-lockfile + - *save_yarn_cache + - run: cd client && yarn run build + - run: cd client && yarn run test + js_lint: + docker: + - image: circleci/node:10-browsers + <<: *set_workdir + steps: + - *restore_yarn_cache + - run: cd client && yarn install --frozen-lockfile + - *save_yarn_cache + - run: cd client && yarn run eslint +workflows: + version: 2 + get_code_and_test: + jobs: + - get_code + - py27_lint: + <<: *requires_get_code + - py27_unit: + <<: *requires_get_code + - py27_first_startup: + <<: *requires_get_code + - py27_docstring: + <<: *requires_get_code + - py35_lint: + <<: *requires_get_code + - py35_unit: + <<: *requires_get_code + - py35_first_startup: + <<: *requires_get_code + - validate_test_tools: + <<: *requires_get_code + - check_py3_compatibility: + <<: *requires_get_code + - js_unit: + <<: *requires_get_code + - js_lint: + <<: *requires_get_code From 173cb185edab4659153525375b20efe9d9957ada Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Fri, 22 Mar 2019 13:08:09 -0400 Subject: [PATCH 2/3] downgrade to node9 images --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01b3105991a..66f50f1b26f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -166,7 +166,7 @@ jobs: - run: tox -e check_py3_compatibility js_unit: docker: - - image: circleci/node:10-browsers + - image: circleci/node:9-browsers <<: *set_workdir steps: - *restore_yarn_cache @@ -176,7 +176,7 @@ jobs: - run: cd client && yarn run test js_lint: docker: - - image: circleci/node:10-browsers + - image: circleci/node:9-browsers <<: *set_workdir steps: - *restore_yarn_cache From a9d211982f95f6edc2ee4acd78370da9b945623a Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Fri, 22 Mar 2019 13:31:18 -0400 Subject: [PATCH 3/3] drop jslint --- .circleci/config.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 66f50f1b26f..1b77b1fd79b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,15 +174,6 @@ jobs: - *save_yarn_cache - run: cd client && yarn run build - run: cd client && yarn run test - js_lint: - docker: - - image: circleci/node:9-browsers - <<: *set_workdir - steps: - - *restore_yarn_cache - - run: cd client && yarn install --frozen-lockfile - - *save_yarn_cache - - run: cd client && yarn run eslint workflows: version: 2 get_code_and_test: @@ -208,5 +199,3 @@ workflows: <<: *requires_get_code - js_unit: <<: *requires_get_code - - js_lint: - <<: *requires_get_code