aboutsummaryrefslogtreecommitdiff
path: root/tcwg-abe-extended.yaml
blob: fc1360c6900bdb8ecd4b988f2e3ed32773a11b84 (plain)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
- job:
    name: tcwg-abe-extended
    project-type: matrix
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 30
    parameters:
        - string:
            name: abe_branch
            default: refs/heads/master
            description: 'ABE revision to test'
    disabled: false
    node: tcwg-x86_64-cam
    retry-count: 3
    concurrent: true
    display-name: 'TCWG BBB ABE extended tests'
    scm:
        - git:
            url: https://git-us.linaro.org/toolchain/abe.git
            refspec: +refs/changes/*:refs/remotes/changes/*
            branches:
                - ${abe_branch}
            skip-tag: true
            shallow-clone: true
            wipe-workspace: true
    axes:
        - axis:
            type: slave
            name: label
            values:
                - tcwg-x86_64-cam
                - docker-trusty-amd64-tcwg
        - axis:
            type: user-defined
            name: testname
            values:
                - canadian_cross_build
                - cross_linux_build_check
                - cross_bare_build_check
                - cross_qemu_build_check
                - native_build_check
                - abe-testsuite
                - abe-tests-arm-linux-gnueabihf
                - abe-tests-arm-none-eabi
                - abe-tests-aarch64-linux-gnu
                - abe-tests-aarch64_be-elf
                - abe-tests-checkout
    execution-strategy:
        combination-filter: |
            (label=="tcwg-x86_64-cam" && testname!="canadian_cross_build") || (label=="docker-trusty-amd64-tcwg" && testname=="canadian_cross_build")
        sequential: false
    wrappers:
        - timeout:
            timeout: 300
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}'
    builders:
        - shell: |
            #!/bin/bash

            if [ "x$label" = "xtcwg-x86_64-cam" ]; then
              schroot_arch=amd64
              schroot_image="tcwg-build-${schroot_arch}-trusty"

              session_id=$(schroot -b -c chroot:$schroot_image --preserve-environment)
              BUILD_SHELL="schroot -r -c session:$session_id --preserve-environment -- bash"
              $BUILD_SHELL -c "echo \"Build session is up; ulimit config:\"; ulimit -a"

              # Sometimes /dev/pts can't get unmounted on the first try.
              # Workaround by retrying.
              trap "schroot -f -e -c session:$session_id || { sleep 60 ; schroot -f -e -c session:$session_id; } || true" 0 1 2 3 5 9 13 15
            else
              BUILD_SHELL=bash
            fi

            gccver=gcc=gcc.git~linaro-6.1-2016.08
            case "$testname" in
              canadian_cross_build)
                # Configure git user info to make git stash happy. It
                # is used during the second build, because the sources
                # are already present.
                git config --global user.email "tcwg-buildslave@linaro.org"
                git config --global user.name "TCWG BuildSlave"
                mkdir _build
                cd _build
                target=arm-linux-gnueabihf
                ${BUILD_SHELL} ../configure --with-git-reference-dir=~tcwg-buildslave/snapshots-ref
                ret=$?
                if test ${ret} -ne 0; then
                  echo "Configure error: ${ret}"
                  exit $ret
                fi
                ${BUILD_SHELL} ${WORKSPACE}/abe.sh --target ${target} --extraconfigdir ../config/gcc6 --build all $gccver
                ret=$?
                if test ${ret} -ne 0; then
                  echo "First build error: ${ret}"
                  exit $ret
                fi
                ${BUILD_SHELL} ${WORKSPACE}/abe.sh --target ${target} --extraconfigdir ../config/gcc6 --build all $gccver --host i686-w64-mingw32
                ret=$?
                if test ${ret} -ne 0; then
                  echo "Second build error: ${ret}"
                  exit $ret
                fi
                #FIXME: check what was actually built
                #FIXME: validate the manifest
                ;;
              *_build_check)
                bootstrap=
                case ${testname} in
                  cross_linux_build_check)
                    target=arm-linux-gnueabihf
                    ;;
                  cross_bare_build_check)
                    target=aarch64-none-elf
                    ;;
                  cross_qemu_build_check)
                    target=armeb-linux-gnueabihf
                    ;;
                  native_build_check)
                    target=native
                    bootstrap=--bootstrap
                    ;;
                esac

                # Build and check a linux target
                ${BUILD_SHELL} -x ${WORKSPACE}/jenkins.sh -t ${target} ${bootstrap} --runtests --excludecheck gdb --override "--extraconfigdir ../config/gcc6 $gccver"
                ret=$?
                #FIXME: check validation results (against a known baseline)
                #FIXME: validate the manifest
                ;;
              abe-testsuite)
                ${BUILD_SHELL} -c "set -ex; ./configure; make check"
                ret=$?
                ;;
              abe-tests-checkout)
                ${BUILD_SHELL} -c "set -ex; git clone https://git.linaro.org/toolchain/abe-tests.git; cd abe-tests; ./test-checkout.sh --clean-snapshots --abe-path `pwd` --ref-snapshots /home/tcwg-buildslave/snapshots-ref"
                ret=$?
                ;;
              abe-tests-*)
                target=$(echo ${testname} | sed 's/abe-tests-//')
                ${BUILD_SHELL} -c "set -ex; git clone https://git.linaro.org/toolchain/abe-tests.git; cd abe-tests; ./test-manifest2.sh --abe-path `pwd` --ref-snapshots /home/tcwg-buildslave/snapshots-ref --quiet --display-report --target ${target}"
                ret=$?
                ;;
            esac
            exit $ret
    publishers:
        - workspace-cleanup:
            include:
              - "*"
            dirmatch: true
        - email:
            recipients: 'christophe.lyon@linaro.org'