xref: /freebsd/.cirrus.yml (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1
2compute_engine_instance:
3  # Image list available via
4  # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images
5  platform: freebsd
6  image_project: freebsd-org-cloud-dev
7  image: freebsd-13-3-release-amd64
8  cpu: 8
9  memory: 8G
10  disk: 40
11
12env:
13  PKG_FORMAT: tar
14
15task:
16  matrix:
17  - name: amd64-llvm16 World and kernel build and boot smoke test
18    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
19    trigger_type: manual
20    env:
21      TARGET: amd64
22      TARGET_ARCH: amd64
23      TOOLCHAIN: llvm16
24      TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
25  - name: amd64-llvm17 World and kernel build and boot smoke test
26    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
27    trigger_type: manual
28    env:
29      TARGET: amd64
30      TARGET_ARCH: amd64
31      TOOLCHAIN: llvm17
32      TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
33  - name: amd64-llvm18 World and kernel build and boot smoke test
34    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
35    trigger_type: manual
36    env:
37      TARGET: amd64
38      TARGET_ARCH: amd64
39      TOOLCHAIN: llvm18
40      TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
41  - name: amd64-llvm19 World and kernel build and boot smoke test
42    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' || $CIRRUS_BRANCH =~ 'pull/.*'
43    env:
44      TARGET: amd64
45      TARGET_ARCH: amd64
46      TOOLCHAIN: llvm19
47      TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
48  - name: arm64-llvm16 World and kernel build and boot smoke test
49    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
50    trigger_type: manual
51    env:
52      TARGET: arm64
53      TARGET_ARCH: aarch64
54      TOOLCHAIN: llvm16
55      TOOLCHAIN_PKG: ${TOOLCHAIN}
56  - name: arm64-llvm17 World and kernel build and boot smoke test
57    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
58    trigger_type: manual
59    env:
60      TARGET: arm64
61      TARGET_ARCH: aarch64
62      TOOLCHAIN: llvm17
63      TOOLCHAIN_PKG: ${TOOLCHAIN}
64  - name: arm64-llvm18 World and kernel build and boot smoke test
65    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
66    trigger_type: manual
67    env:
68      TARGET: arm64
69      TARGET_ARCH: aarch64
70      TOOLCHAIN: llvm18
71      TOOLCHAIN_PKG: ${TOOLCHAIN}
72  - name: arm64-llvm19 World and kernel build and boot smoke test
73    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
74    trigger_type: manual
75    env:
76      TARGET: arm64
77      TARGET_ARCH: aarch64
78      TOOLCHAIN: llvm19
79      TOOLCHAIN_PKG: ${TOOLCHAIN}
80  - name: amd64-gcc12 World and kernel build and boot smoke test (manual)
81    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
82    trigger_type: manual
83    env:
84      TARGET: amd64
85      TARGET_ARCH: amd64
86      TOOLCHAIN: amd64-gcc12
87      TOOLCHAIN_PKG: ${TOOLCHAIN}
88      EXTRA_MAKE_FLAGS: -s
89  - name: amd64-gcc13 World and kernel build and boot smoke test (manual)
90    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
91    trigger_type: manual
92    env:
93      TARGET: amd64
94      TARGET_ARCH: amd64
95      TOOLCHAIN: amd64-gcc13
96      TOOLCHAIN_PKG: ${TOOLCHAIN}
97      EXTRA_MAKE_FLAGS: -s
98  - name: aarch64-gcc12 World and kernel build and boot smoke test (manual)
99    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
100    trigger_type: manual
101    env:
102      TARGET: arm64
103      TARGET_ARCH: aarch64
104      TOOLCHAIN: aarch64-gcc12
105      TOOLCHAIN_PKG: ${TOOLCHAIN}
106      EXTRA_MAKE_FLAGS: -s
107  - name: aarch64-gcc13 World and kernel build and boot smoke test (manual)
108    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
109    trigger_type: manual
110    env:
111      TARGET: arm64
112      TARGET_ARCH: aarch64
113      TOOLCHAIN: aarch64-gcc13
114      TOOLCHAIN_PKG: ${TOOLCHAIN}
115      EXTRA_MAKE_FLAGS: -s
116  - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo)
117    only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*'
118    env:
119      TARGET: amd64
120      TARGET_ARCH: amd64
121      TOOLCHAIN: amd64-gcc12
122      TOOLCHAIN_PKG: ${TOOLCHAIN}
123      EXTRA_MAKE_FLAGS: -s
124  timeout_in: 120m
125  install_script:
126  - sh .cirrus-ci/pkg-install.sh ${TOOLCHAIN_PKG} git-lite
127
128  setup_script:
129  - uname -a
130  - gpart show
131  - df -m
132  - pkg --version
133  - pw useradd -n user -m
134  - mkdir -p /usr/obj/$(pwd -P)
135  - chown user:user /usr/obj/$(pwd -P)
136  - su user -c "git config --global --add safe.directory $(pwd -P)"
137
138  build_world_script:
139  - su user -c "make -j$(sysctl -n hw.ncpu) ${EXTRA_MAKE_FLAGS} CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes buildworld"
140
141  build_kernel_script:
142  - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes buildkernel"
143
144  package_script:
145  - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes packages"
146
147  package_check_script:
148  - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG"
149
150  test_script:
151  - sh .cirrus-ci/pkg-install.sh qemu-nox11
152  - sh tools/boot/ci-qemu-test.sh
153
154  make_sysent_script:
155  # Check that make sysent results were committed if required
156  - make sysent
157  - if ! git diff --exit-code; then printf "\n>>> Generated sysent files not updated, run make sysent <<<\n"; false; fi
158
159  include_ldirs_script:
160  # Check that includes/Makefile refers to existing directories
161  - if ! make -C include/ check-ldirs; then printf "\n>>> include/Makefile lists nonexistant directories <<<\n"; false; fi
162
163  makeman_script:
164  # Check that the committed src.conf.5 matches the one generated by
165  # tools/build/options/makeman (modulo the date which always updates)
166  # XXX: This script is slow so keep it last
167  - (make makeman 2> /tmp/makeman.out); cat /tmp/makeman.out
168  - if ! git diff --exit-code --ignore-matching-lines "^.Dd" share/man/man5/src.conf.5; then printf "\n>>> src.conf.5 was not updated as required <<<\n"; false; fi
169  - if grep -q "no description found" /tmp/makeman.out; then printf "\n>>> Missing description files <<<\n"; false; fi
170
171  post_script:
172  - df -m
173  - du -m -s /usr/obj
174