forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
141 lines (134 loc) · 4.92 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# 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
install_ffprobe: &install_ffprobe
run: sudo apt-get update && sudo apt-get install ffmpeg -y
set_workdir: &set_workdir
working_directory: ~/repo
requires_get_code: &requires_get_code
requires:
- get_code
jobs:
get_code:
docker:
- image: circleci/python:3.6
<<: *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://[email protected]".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
validate_test_tools:
docker:
- image: circleci/python:3.6
<<: *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
test_galaxy_packages:
docker:
- image: circleci/python:3.6
<<: *set_workdir
steps:
- *restore_repo_cache
- *install_tox
- *install_ffprobe
- run: tox -e test_galaxy_packages
js_unit:
docker:
- image: circleci/node:12-browsers
<<: *set_workdir
steps:
- *restore_yarn_cache
- run: cd client && yarn install --frozen-lockfile
- *save_yarn_cache
- run:
name: Build client
command: cd client && yarn run build
environment:
NODE_OPTIONS: --max_old_space_size=4096
- run: cd client && yarn run qunit
js_lint:
docker:
- image: circleci/node:12-browsers
<<: *set_workdir
steps:
- *restore_yarn_cache
- run: cd client && yarn install --frozen-lockfile
- *save_yarn_cache
- run: cd client && yarn run eslint
- run: cd client && yarn run prettier-check
workflows:
version: 2
get_code_and_test:
jobs:
- get_code
- test_galaxy_packages:
<<: *requires_get_code
- validate_test_tools:
<<: *requires_get_code
- js_unit:
<<: *requires_get_code
- js_lint:
<<: *requires_get_code