Skip to content

Commit 3c3af46

Browse files
committed
WIP: evaluate Circle CI
This runs in circleci's python 2.7 docker image which is based on debian jessie, mostly for convenience since that image has a non-root user added and some of the Julia tests work differently when run as root. Circle CI caching is a little odd - I'm using ccache here since it's actually fast enough to handle it pretty well, about 15 minutes to build deps from scratch and about 3 minutes to build deps with a primed ccache. We save the ARCH, HOME (default location where ccache saves its data, in case we switch containers and try to run tests as a different user), and year and week number into a tag file, then determine which saved circleci cache tag to load from based on the checksum of that tag file. So this will throw out the cache and have to rebuild it once a week, but since that only adds about 10-15 minutes to a build that's not a big deal. It would be better if circle's cache worked like Travis and AppVeyor's where it loads the latest and checksums the content to decide whether to upload a new replacement cache, but that's up to circle to fix. This has to skip the socket tests, since circle doesn't currently support ipv6 in their docker workers. They have other types of workers, but they aren't anywhere near as fast to build or run tests. This currently doesn't do a doc build or deployment, that's a TODO if we decide to switch to this. It also looks like it checks out the branch tip instead of the merge commit, but that should be fixable. [av skip] [bsd skip]
1 parent a62160e commit 3c3af46

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

circle.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
version: 2
2+
workflows:
3+
version: 2
4+
linux-builds:
5+
jobs:
6+
- build-x86_64
7+
- build-i686
8+
9+
jobs:
10+
build-x86_64:
11+
docker:
12+
# - image: ubuntu:14.04
13+
- image: circleci/python:2.7
14+
environment:
15+
JULIA_CPU_CORES: 4
16+
JULIA_TEST_MAXRSS_MB: 800
17+
ARCH: x86_64
18+
# resource_class: xlarge
19+
steps: &steps
20+
# apt-get update &&
21+
# curl make patch m4 xz-utils git time ccache bar
22+
- run: | # install build dependencies
23+
sudo apt-get install -y g++-4.8-multilib gfortran-4.8-multilib \
24+
time ccache bar &&
25+
for prog in gcc g++ gfortran; do
26+
sudo ln -s /usr/bin/$prog-4.8 /usr/local/bin/$prog;
27+
done
28+
- checkout # circle ci code checkout step - TODO checkout PR merge commit
29+
# (FIXME: need to unset url."ssh://[email protected]".insteadOf or libgit2 tests fail)
30+
- run: | # set versioning info and Make.user variables
31+
git config --global --unset url."ssh://[email protected]".insteadOf &&
32+
make -C base version_git.jl.phony &&
33+
echo "override ARCH = $ARCH" | tee -a Make.user &&
34+
for var in FORCE_ASSERTIONS LLVM_ASSERTIONS USECCACHE NO_GIT; do
35+
echo "override $var = 1" | tee -a Make.user;
36+
done &&
37+
echo "$ARCH $HOME $(date +%Y%W)" | tee /tmp/weeknumber
38+
- restore_cache: # silly to take a checksum of the tag file here instead of
39+
keys: # its contents but this is the only thing that works on circle
40+
- ccache-{{ checksum "/tmp/weeknumber" }}
41+
- run: | # build deps
42+
contrib/download_cmake.sh &&
43+
make -j8 -C deps || make
44+
- run: | # build julia, output ccache stats when done
45+
make -j8 all &&
46+
make prefix=/tmp/julia install &&
47+
ccache -s &&
48+
make build-stats
49+
- run: | # move source tree out of the way, run tests from install tree
50+
cd .. &&
51+
mv project julia-src &&
52+
/tmp/julia/bin/julia -e 'versioninfo()' &&
53+
/tmp/julia/bin/julia --precompiled=no -e 'true' &&
54+
/tmp/julia/bin/julia-debug --precompiled=no -e 'true' &&
55+
pushd /tmp/julia/share/julia/test &&
56+
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip socket | bar -i 30 &&
57+
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg &&
58+
popd &&
59+
mkdir /tmp/embedding-test &&
60+
make check -C /tmp/julia/share/doc/julia/examples/embedding \
61+
JULIA=/tmp/julia/bin/julia BIN=/tmp/embedding-test \
62+
"$(cd julia-src && make print-CC)" &&
63+
mv julia-src project
64+
# - run: cd project && make -C doc deploy
65+
# - run:
66+
# command: sudo dmesg
67+
# when: on_fail
68+
- save_cache:
69+
key: ccache-{{ checksum "/tmp/weeknumber" }}
70+
paths:
71+
- ~/.ccache
72+
73+
build-i686:
74+
docker:
75+
# - image: ubuntu:14.04
76+
- image: circleci/python:2.7
77+
environment:
78+
JULIA_CPU_CORES: 4
79+
JULIA_TEST_MAXRSS_MB: 800
80+
ARCH: i686
81+
# resource_class: xlarge
82+
steps: *steps

0 commit comments

Comments
 (0)