1 # This file is part of LilyPond, the GNU music typesetter.
3 # Copyright (C) 2020--2023 Jonas Hahnfeld <hahnjo@hahnjo.de>
5 # LilyPond is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # LilyPond is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
25 image: registry.gitlab.com/lilypond/lilypond/ci/ubuntu-22.04:20240516
28 # Conditionally include a file to add the tag 'lilypond' to all jobs so that
29 # they are assigned to our custom runners, but we can leave the shared runners
30 # enabled for external contributors forking the repository.
32 - local: .gitlab-ci.lilypond.yml
34 - if: $CI_PROJECT_PATH == "lilypond/lilypond"
36 .if-default-branch: &if-default-branch
37 if: $CI_PROJECT_PATH == "lilypond/lilypond" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
39 .if-mr-to-default: &if-mr-to-default
40 if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
42 .if-stable-branch: &if-stable-branch
43 if: $CI_PROJECT_PATH == "lilypond/lilypond" && $CI_COMMIT_BRANCH =~ /stable\/.*/
45 .if-schedule-or-web: &if-schedule-or-web
46 if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
48 # Source files are checked out freshly for each job. This leads to the situation
49 # that make considers the artifacts outdated and rebuilds LilyPond from scratch.
50 # .touch-build contains the command needed to touch the downloaded build files,
51 # grouped into a pre-collapsed custom section.
52 .touch-build: &touch-build
53 - echo -e "section_start:`date +%s`:touch_build[collapsed=true]\r\e[0KTouch build artifacts"
54 - make -C python --touch all
55 - make -C scripts --touch all
56 - make -C flower --touch all
57 - make -C lily --touch all
58 - make -C mf --touch all
59 - echo -e "section_end:`date +%s`:touch_build\r\e[0K"
62 CONFIGURE_FLAGS: "--ci"
63 # Always clone and build in the same directory to avoid problems with
64 # 'make test-baseline' and 'make check'.
65 GIT_CLONE_PATH: "/builds/lilypond/lilypond"
67 # An additional variable not set here but used below is $MAKE_FLAGS. This can
68 # be set per runner and allows to enable parallel builds. For example, set its
69 # value to "-j4 CPU_COUNT=4" in order to speed up the build.
74 - <<: *if-default-branch
75 - <<: *if-mr-to-default
76 - <<: *if-stable-branch
77 - <<: *if-schedule-or-web
79 - mkdir build && cd build
80 - ../autogen.sh $CONFIGURE_FLAGS
85 - "build/Documentation/out/**"
86 - "build/out/lybook-db/**"
92 - <<: *if-default-branch
94 - <<: *if-mr-to-default
95 - <<: *if-stable-branch
96 - <<: *if-schedule-or-web
98 - mkdir build && cd build
99 - ../autogen.sh $CONFIGURE_FLAGS CC=clang CXX=clang++
105 - <<: *if-default-branch
107 - <<: *if-stable-branch
108 - <<: *if-schedule-or-web
109 dependencies: [ "build" ]
113 - make $MAKE_FLAGS test
123 - <<: *if-default-branch
124 dependencies: [ "build" ]
126 # Needed to work around the fact that gitlab-runner changes the mode of link
127 # targets until a proper fix is merged and released:
128 # https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/3547
132 - make $MAKE_FLAGS test-baseline
133 - tar czf ../test-baseline.tar.gz input/regression/out-test-baseline input/regression/*/out-test-baseline out-baseline
138 - "test-baseline.tar.gz"
144 - <<: *if-mr-to-default
145 dependencies: [ "build" ]
149 - ../scripts/auxiliar/download-test-baseline.sh
150 - make $MAKE_FLAGS check
151 - mv out/test-results/ ..
152 # $CI_PAGES_URL refers to the GitLab Pages of the repository, we want the
153 # "implicit" pages URL with a dash before the project name. Do not use
154 # $CI_PAGES_DOMAIN to construct it because that is only available if GitLab
155 # Pages are enabled for the repository (which may be a user's fork).
156 - echo "Results can be viewed at https://$CI_PROJECT_ROOT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/test-results/index.html"
168 - <<: *if-default-branch
170 - <<: *if-mr-to-default
171 - <<: *if-stable-branch
172 - <<: *if-schedule-or-web
173 dependencies: [ "build" ]
177 - make $MAKE_FLAGS doc
188 - <<: *if-default-branch
191 dependencies: [ "build" ]
195 - make $MAKE_FLAGS website
201 - "build/out/website-root/**"