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