Skip to content

Nightly full build and test run #782

Nightly full build and test run

Nightly full build and test run #782

Workflow file for this run

---
# 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/*