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-2-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' || $CIRRUS_BRANCH =~ 'pull/.*'
35    env:
36      TARGET: amd64
37      TARGET_ARCH: amd64
38      TOOLCHAIN: llvm18
39      TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
40  - name: arm64-llvm16 World and kernel build and boot smoke test
41    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
42    trigger_type: manual
43    env:
44      TARGET: arm64
45      TARGET_ARCH: aarch64
46      TOOLCHAIN: llvm16
47      TOOLCHAIN_PKG: ${TOOLCHAIN}
48  - name: arm64-llvm17 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: llvm17
55      TOOLCHAIN_PKG: ${TOOLCHAIN}
56  - name: arm64-llvm18 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: llvm18
63      TOOLCHAIN_PKG: ${TOOLCHAIN}
64  - name: amd64-gcc12 World and kernel build and boot smoke test (manual)
65    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
66    trigger_type: manual
67    env:
68      TARGET: amd64
69      TARGET_ARCH: amd64
70      TOOLCHAIN: amd64-gcc12
71      TOOLCHAIN_PKG: ${TOOLCHAIN}
72      EXTRA_MAKE_FLAGS: -s
73  - name: amd64-gcc13 World and kernel build and boot smoke test (manual)
74    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
75    trigger_type: manual
76    env:
77      TARGET: amd64
78      TARGET_ARCH: amd64
79      TOOLCHAIN: amd64-gcc13
80      TOOLCHAIN_PKG: ${TOOLCHAIN}
81      EXTRA_MAKE_FLAGS: -s
82  - name: aarch64-gcc12 World and kernel build and boot smoke test (manual)
83    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
84    trigger_type: manual
85    env:
86      TARGET: arm64
87      TARGET_ARCH: aarch64
88      TOOLCHAIN: aarch64-gcc12
89      TOOLCHAIN_PKG: ${TOOLCHAIN}
90      EXTRA_MAKE_FLAGS: -s
91  - name: aarch64-gcc13 World and kernel build and boot smoke test (manual)
92    only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
93    trigger_type: manual
94    env:
95      TARGET: arm64
96      TARGET_ARCH: aarch64
97      TOOLCHAIN: aarch64-gcc13
98      TOOLCHAIN_PKG: ${TOOLCHAIN}
99      EXTRA_MAKE_FLAGS: -s
100  - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo)
101    only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*'
102    env:
103      TARGET: amd64
104      TARGET_ARCH: amd64
105      TOOLCHAIN: amd64-gcc12
106      TOOLCHAIN_PKG: ${TOOLCHAIN}
107      EXTRA_MAKE_FLAGS: -s
108  timeout_in: 120m
109  install_script:
110  - sh .cirrus-ci/pkg-install.sh ${TOOLCHAIN_PKG} git-lite
111
112  setup_script:
113  - uname -a
114  - gpart show
115  - df -m
116  - pkg --version
117  - pw useradd -n user -m
118  - mkdir -p /usr/obj/$(pwd -P)
119  - chown user:user /usr/obj/$(pwd -P)
120  - su user -c "git config --global --add safe.directory $(pwd -P)"
121
122  build_world_script:
123  - su user -c "make -j$(sysctl -n hw.ncpu) ${EXTRA_MAKE_FLAGS} CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes buildworld"
124
125  build_kernel_script:
126  - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes buildkernel"
127
128  package_script:
129  - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes packages"
130
131  package_check_script:
132  - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG"
133
134  test_script:
135  - sh .cirrus-ci/pkg-install.sh qemu-nox11
136  - sh tools/boot/ci-qemu-test.sh
137
138  make_sysent_script:
139  # Check that make sysent results were committed if required
140  - make sysent
141  - if ! git diff --exit-code; then printf "\n>>> Generated sysent files not updated, run make sysent <<<\n"; false; fi
142
143  include_ldirs_script:
144  # Check that includes/Makefile refers to existing directories
145  - if ! make -C include/ check-ldirs; then printf "\n>>> include/Makefile lists nonexistant directories <<<\n"; false; fi
146
147  makeman_script:
148  # Check that the committed src.conf.5 matches the one generated by
149  # tools/build/options/makeman (modulo the date which always updates)
150  # XXX: This script is slow so keep it last
151  - (make makeman 2> /tmp/makeman.out); cat /tmp/makeman.out
152  - 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
153  - if grep -q "no description found" /tmp/makeman.out; then printf "\n>>> Missing description files <<<\n"; false; fi
154
155  post_script:
156  - df -m
157  - du -m -s /usr/obj
158