-
Notifications
You must be signed in to change notification settings - Fork 7
143 lines (123 loc) · 5.14 KB
/
cron-build.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
# Nightly test run
name: Nightly full build and test run
on:
schedule:
- cron: 0 4 * * *
workflow_dispatch:
inputs:
ref:
description: Branch, tag, or commit SHA to run the tests against
required: false
default: main
jobs:
# Build an image to share across jobs
build-oss-container:
name: Build container for testing
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref || 'main' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build OSS container and export
run: |
make container-oss -e DOCKER_USER=couchbaselabs -e DOCKER_TAG=${{ github.sha }}
docker save --output /tmp/cmos-image.tar couchbaselabs/observability-stack:${{ github.sha }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: cmos-image
path: /tmp/cmos-image.tar
test-oss-containers-and-k8s:
name: Full build and test - OSS - containers and k8s
needs: build-oss-container
runs-on: ubuntu-20.04
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
server-version: [6.6.3, 7.0.2]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref || 'main' }}
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: cmos-image
path: /tmp
- name: Load CMOS image
run: |
docker load --input /tmp/cmos-image.tar
docker image ls -a
- name: Install BATS
timeout-minutes: 5
run: |
sudo npm install -g bats
- name: Create K8S Kind Cluster
timeout-minutes: 10
uses: helm/kind-action@v1.2.0
with:
cluster_name: kind-${{ github.sha }}
- name: Run ${{ matrix.server-version }} tests
run: |
make TEST_SUITE=all test-containers -e COUCHBASE_SERVER_VERSION=${{ matrix.server-version }} -e DOCKER_USER=couchbaselabs -e DOCKER_TAG=${{ github.sha }}
# CMOS-97
make TEST_SUITE=integration/kubernetes test-kubernetes -e COUCHBASE_SERVER_VERSION=${{ matrix.server-version }} -e DOCKER_USER=couchbaselabs -e DOCKER_TAG=${{ github.sha }}
- name: Capture cmosinfo if something went wrong
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: test-failure-cmosinfo-${{ matrix.server-version }}-containers
path: testing/diagnostics/cmosinfo/*
build-test-oss-native:
name: CICD for the OSS variant (Native)
runs-on: macos-10.15 # Apparently macOS is the only environment that supports nested virtualisation
needs: build-oss-container
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
server-version: [6.6.3, 7.0.2]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref || 'main' }}
- name: Apply VirtualBox workaround for networking issues
# (https://www.virtualbox.org/ticket/20636#comment:20)
# Ensure anyone can read it who needs to as well.
run: |
sudo mkdir -p /etc/vbox/
sudo sh -c 'echo "* 0.0.0.0/0 ::/0" >> /etc/vbox/networks.conf'
sudo chmod a+r /etc/vbox/networks.conf
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: cmos-image
path: /tmp
- name: Load CMOS image
run: |
docker load --input /tmp/cmos-image.tar
docker image ls -a
- name: Install requirements
timeout-minutes: 15
run: |
brew unlink bats # The version that ships with the image is outdated
brew install bats-core ansible
- name: Run ${{ matrix.server-version }} tests
run: |
make TEST_SUITE=all test-native -e COUCHBASE_SERVER_VERSION=${{ matrix.server-version }} -e DOCKER_USER=couchbaselabs -e DOCKER_TAG=${{ github.sha }}
- name: Capture cmosinfo if something went wrong
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: test-failure-cmosinfo-${{ matrix.server-version }}-native
path: testing/diagnostics/cmosinfo/*