Skip to content

Commit cc4b93c

Browse files
ci: add on-demand autotls beekeeper workflow (#5478)
1 parent 85b1e92 commit cc4b93c

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# AutoTLS Beekeeper integration tests.
2+
#
3+
# Manual-only workflow: it never runs on push/PR commits (the AutoTLS cluster is
4+
# slow to spin up). Trigger it on demand from the Actions tab via "Run workflow":
5+
# - pick the branch to test in the "Use workflow from" dropdown (or pass an
6+
# explicit `ref` input), and
7+
# - optionally override the beekeeper/beelocal branches used by the tooling.
8+
name: Beekeeper AutoTLS
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
ref:
14+
description: "Branch/tag/SHA to test (defaults to the branch selected above)"
15+
required: false
16+
default: ""
17+
beekeeper_branch:
18+
description: "beekeeper repo branch (tooling/checks)"
19+
required: false
20+
default: "master"
21+
beelocal_branch:
22+
description: "beelocal repo branch (cluster setup)"
23+
required: false
24+
default: "main"
25+
# TEMPORARY: lets this PR validate the workflow before it reaches master
26+
# (workflow_dispatch is only available once the file is on the default branch).
27+
# Remove before merge. Note: inputs are empty under pull_request, so the env
28+
# fallbacks below apply (BEEKEEPER_BRANCH=master, BEELOCAL_BRANCH=main).
29+
pull_request:
30+
paths:
31+
- .github/workflows/beekeeper-autotls.yml
32+
33+
env:
34+
K3S_VERSION: "v1.31.10+k3s1"
35+
REPLICA: 3
36+
SETUP_CONTRACT_IMAGE: "ethersphere/bee-localchain"
37+
SETUP_CONTRACT_IMAGE_TAG: "0.9.4"
38+
# Default to the upstream branches; override per-run via the workflow inputs
39+
# (e.g. point at the feature branches that define the local-dns-autotls cluster
40+
# and the ci-autotls check until that support is merged upstream).
41+
BEELOCAL_BRANCH: ${{ inputs.beelocal_branch || 'main' }}
42+
BEEKEEPER_BRANCH: ${{ inputs.beekeeper_branch || 'master' }}
43+
BEEKEEPER_METRICS_ENABLED: false
44+
REACHABILITY_OVERRIDE_PUBLIC: true
45+
BATCHFACTOR_OVERRIDE_PUBLIC: 2
46+
TIMEOUT: 30m
47+
P2P_WSS_ENABLE: true
48+
PEBBLE_IMAGE_TAG: "2.9.0"
49+
P2P_FORGE_IMAGE_TAG: "v0.7.0"
50+
PEBBLE_CERTIFICATE_VALIDITY_PERIOD: "500"
51+
52+
jobs:
53+
beekeeper-autotls:
54+
name: Integration tests (autotls)
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v5
59+
with:
60+
fetch-depth: 0
61+
# explicit ref input wins; otherwise the branch picked in the "Run workflow" dropdown.
62+
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }}
63+
- name: Setup Go
64+
uses: actions/setup-go@v6
65+
with:
66+
cache: false
67+
go-version-file: go.mod
68+
- name: Cache Go Modules
69+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
70+
with:
71+
path: |
72+
~/.cache/go-build
73+
~/go/pkg/mod
74+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
75+
restore-keys: |
76+
${{ runner.os }}-go-
77+
- name: Cache k3s
78+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
79+
with:
80+
path: |
81+
/tmp/k3s-${{ env.K3S_VERSION }}
82+
key: k3s-${{ env.K3S_VERSION }}
83+
- name: Build bee
84+
run: |
85+
patch pkg/api/postage.go .github/patches/postage_api.patch
86+
patch pkg/retrieval/retrieval.go .github/patches/retrieval.patch
87+
make binary
88+
mv dist/bee bee
89+
- name: Install beekeeper
90+
run: |
91+
export PATH=$(pwd):$PATH
92+
timeout ${TIMEOUT} make beekeeper BEEKEEPER_INSTALL_DIR=$(pwd)
93+
beekeeper version --log-verbosity 0
94+
sudo mv beekeeper /usr/local/bin/beekeeper
95+
- name: Prepare local cluster
96+
run: timeout ${TIMEOUT} make beelocal OPTS='ci skip-vet' ACTION=prepare
97+
- name: Set kube config
98+
run: |
99+
mkdir -p ~/.kube
100+
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
101+
- name: Set local cluster (local-dns-autotls)
102+
run: timeout ${TIMEOUT} make deploylocal BEEKEEPER_CLUSTER=local-dns-autotls
103+
- name: Test pingpong (autotls)
104+
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns-autotls --checks ci-pingpong; do echo "waiting for pingpong..."; sleep .3; done'
105+
- name: Test fullconnectivity (autotls)
106+
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns-autotls --checks=ci-full-connectivity; do echo "waiting for full connectivity..."; sleep .3; done'
107+
- name: Test retrieval (autotls)
108+
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns-autotls --checks=ci-retrieval
109+
- name: Test autotls
110+
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns-autotls --checks=ci-autotls

0 commit comments

Comments
 (0)