forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
97 lines (85 loc) · 4.06 KB
/
circle.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
# Requires the BETA setting to use Ubunty 14.04 Trusty
# It appears that the current directory is reset at the start of each `-` line,
# so for example to do an out-of-source build, you have to chain operations
# after `cd`: `cd build && cmake .. `.
machine:
environment:
PATH: "~/$CIRCLE_PROJECT_REPONAME/ldc2-1.0.0-linux-x86_64/bin:$PATH"
dependencies:
cache_directories:
- ldc2-1.0.0-linux-x86_64
#- clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04
pre:
# LLVM's official APT repo:
- sudo add-apt-repository -y 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty main'
- wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
- sudo apt-get update
# Download and cache a prebuilt LLVM package:
#- if [[ ! -e clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04 ]]; then wget http://llvm.org/releases/3.8.0/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz && xzcat clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz | tar -xvf - ; fi
# Download and cache a prebuilt LDC package:
- if [[ ! -e ldc2-1.0.0-linux-x86_64/bin/ldc2 ]]; then wget https://github.com/ldc-developers/ldc/releases/download/v1.0.0/ldc2-1.0.0-linux-x86_64.tar.xz && xzcat ldc2-1.0.0-linux-x86_64.tar.xz | tar -xvf - ; fi
override:
- sudo apt-get remove clang llvm
- sudo apt-get install libconfig++8-dev libedit-dev
- sudo apt-get install llvm-4.0 llvm-4.0-dev clang-4.0
- pip install --user lit
post:
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 99
- sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 99
#- sudo update-alternatives --install /usr/bin/clang clang ~/$CIRCLE_PROJECT_REPONAME/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang 99
#- sudo update-alternatives --install /usr/bin/clang++ clang++ ~/$CIRCLE_PROJECT_REPONAME/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++ 99
- gcc --version
- clang --version
- ldc2 -version
- cmake --version
- python -c "import lit; lit.main();" --version | head -n 1
- gdb --version
# Use ld.gold per default, so that LTO is tested.
- sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold 99
- ld --version
checkout:
post:
- git submodule sync
- git submodule update --init
test:
pre:
# Build first with a released LDC
- mkdir build
- cd build && export CC=clang && export CXX=clang++ && cmake .. && make -j3 && bin/ldc2 -version || exit 1
# Now build LDC with itself and use this second build for further testing
- CC=clang CXX=clang++ cmake -DD_COMPILER="build/bin/ldmd2" -DLDC_INSTALL_LTOPLUGIN=ON .
- make -j3
- bin/ldc2 -version || exit 1
override:
- make -j2 phobos2-ldc-unittest-debug phobos2-ldc-unittest
- make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest
- CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest --verbose -R "dmd-testsuite"
- ctest --output-on-failure -V -R "lit-tests"
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests"
# To add more value the test results could be collected, see https://circleci.com/docs/test-metadata
# A way how to convert the ctest output is described here:
# http://stackoverflow.com/questions/6329215/how-to-get-ctest-results-in-hudson-jenkins
# The tests could be run in 4 parallel containers. The syntax is shown below.
# The containers were started but only the tests from container 0 were run.
# Containers 1-3 also started the tests but stop with the message
# "No tests were found!!!"
#
# - ? |
# echo $CIRCLE_NODE_INDEX
# case $CIRCLE_NODE_INDEX in
# 0)
# MAKEOPTS=-j8 ctest -j4 --verbose -R "build-phobos2-ldc-unittest"
# ;;
# 1)
# MAKEOPTS=-j8 ctest -j4 --verbose -R "build-druntime-ldc-unittest"
# ;;
# 2)
# CC="" MAKEOPTS=-j8 ctest --verbose -R "dmd-testsuite"
# ;;
# 3)
# MAKEOPTS=-j8 ctest --verbose -R "-test-runner"
# ;;
# esac
# :
# parallel: true
# - ctest -j8 --output-on-failure -E "testsuite"