-
Notifications
You must be signed in to change notification settings - Fork 36
/
.cirrus.yml
114 lines (89 loc) · 3.34 KB
/
.cirrus.yml
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
---
env:
GOPATH: "/var/tmp/go"
CIRRUS_WORKING_DIR: "${GOPATH}/src/github.com/containers/oci-seccomp-bpf-hook"
GOSRC: "$CIRRUS_WORKING_DIR"
SCRIPT_BASE: "./contrib/cirrus"
CIRRUS_SHELL: "/bin/bash"
IMAGE_PROJECT: "libpod-218412"
HOME: "/root" # not set by default
GOCACHE: "${HOME}/.cache/go-build"
# VM Image built in containers/automation_images
IMAGE_SUFFIX: "c20241107t210000z-f41f40d13"
FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}"
RAWHIDE_CACHE_IMAGE_NAME: "rawhide-${IMAGE_SUFFIX}"
# Must be defined true when testing w/in containers
CONTAINER: "false"
gcp_credentials: ENCRYPTED[2ba9cffb563741f8538eab6d4a8b2d4684c0de23693a8ade80aced34596669a87a6c01e45ce45fad7f7db1d995e8c777]
# Update metadata on VM images referenced by this repository state
meta_task:
container:
image: "quay.io/libpod/imgts:latest"
cpu: 1
memory: 1
env:
CONTAINER: true
# Space-separated list of images used by this repository state
IMGNAMES: |-
${FEDORA_CACHE_IMAGE_NAME}
${RAWHIDE_CACHE_IMAGE_NAME}
BUILDID: "${CIRRUS_BUILD_ID}"
REPOREF: "${CIRRUS_CHANGE_IN_REPO}"
GCPJSON: ENCRYPTED[ef070c453a5ce68efca096a940835fdca530ed0ec2272ddb52bb02bf7d70dcc3ac9697b85b1d8dcce851931e008f63c0]
GCPNAME: ENCRYPTED[613aa269172e01265b2ee788fcc6187826da56d3efe2e26f5790b471c9ff84c010d72dfbee1cca367ff3982d4919d617]
GCPPROJECT: ${IMAGE_PROJECT}
CIRRUS_CLONE_DEPTH: 1 # source not used
script: /usr/local/bin/entrypoint.sh
# make sure that the ./vendor directory is up to date
vendor_task:
container:
image: golang:1.22
script:
- make vendor
# run unit and integration tests
build_and_test_task:
gce_instance:
image_project: "${IMAGE_PROJECT}"
zone: "us-central1-c" # Required by Cirrus for the time being
cpu: 2
memory: "4Gb"
disk: 200 # Required for performance reasons
image_name: "${FEDORA_CACHE_IMAGE_NAME}"
matrix:
- name: "Test on Fedora"
gce_instance:
image_name: "${FEDORA_CACHE_IMAGE_NAME}"
- name: "Test on Rawhide"
gce_instance:
image_name: "${RAWHIDE_CACHE_IMAGE_NAME}"
# Avoid downloading this stuff every time
gocache_cache:
folder: "${GOCACHE}"
fingerprint_script: $SCRIPT_BASE/cache_fingerprint.sh
# Avoid needless rebuilding of tooling binaries
gopath_cache:
folder: "${GOPATH}/bin"
fingerprint_script: $SCRIPT_BASE/cache_fingerprint.sh
# Avoid needless rebuilding of source binaries
gosrc_bin_cache:
folder: "${CIRRUS_WORKING_DIR}/bin"
fingerprint_script: $SCRIPT_BASE/cache_fingerprint.sh
# Avoid needless rebuilding of docs
gosrc_docs_cache:
folder: "${CIRRUS_WORKING_DIR}/docs"
fingerprint_script: $SCRIPT_BASE/cache_fingerprint.sh
script:
- $SCRIPT_BASE/setup.sh
- make binary
- make install.tools
- make validate
- make docs
- sudo make PREFIX=/usr install
- make test-unit
- sudo make test-integration
# The hook runs in the background, errors will be in the journal.
always:
journal_script: journalctl -b
binaries_artifacts:
path: "bin/*"
type: "application/octet-stream"