Skip to content

Commit 397a0fb

Browse files
authored
Nightly tests (#444)
* add a simple staging test * add buildkite stuff * buildkite setup like in the [example](https://github.com/buildkite/golang-example) * yamllint * add running geth for 1m as a buildkite command * fixups post go mod * workaround a stupid go issue * add 1 hour test * fix bash maths * run the job for 5 hours
1 parent fbe7a2c commit 397a0fb

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

.buildkite/hooks/pre-command

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set +u
4+
5+
echo "--- :golang: Setting up Golang build environment"
6+
7+
if [[ ! -z "${BUILDKITE_GOLANG_IMPORT_PATH:-}" ]] && [[ "$BUILDKITE_GOLANG_IMPORT_PATH" != "" ]]; then
8+
NEW_GOPATH="$(pwd)/tmp/go"
9+
NEW_BUILD_CHECKOUT_PATH="$NEW_GOPATH/src/$BUILDKITE_GOLANG_IMPORT_PATH"
10+
11+
# Create the regular GOPATH folders
12+
mkdir -p "$NEW_GOPATH/bin"
13+
mkdir -p "$NEW_GOPATH/src"
14+
15+
# Create the /src/x.com/project/name path, and create a symlink of the
16+
# current build to that new directory
17+
mkdir -p "$NEW_BUILD_CHECKOUT_PATH"
18+
rm -rf "$NEW_BUILD_CHECKOUT_PATH"
19+
ln -s "$(pwd)" "$NEW_BUILD_CHECKOUT_PATH"
20+
21+
export GOPATH=$NEW_GOPATH
22+
echo "New \$GOPATH is set to $NEW_GOPATH"
23+
echo "Build will now be at $NEW_BUILD_CHECKOUT_PATH"
24+
25+
export BUILDKITE_BUILD_CHECKOUT_PATH=$NEW_BUILD_CHECKOUT_PATH
26+
else
27+
echo "No \$BUILDKITE_GOLANG_IMPORT_PATH set, skipping..."
28+
fi

.buildkite/pipeline.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
steps:
3+
- command: './nightly.sh'
4+
label: 'build & run geth'
5+
env:
6+
BUILDKITE_GOLANG_IMPORT_PATH: "github.com/ledgerwatch/turbo-geth"

nightly.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# running the job for 5 hours
4+
let SLEEP_TIME=5*60*60
5+
6+
# GOFLAGS=-modcacherw is required for our CI
7+
# to be able to remove go modules cache
8+
GOFLAGS=-modcacherw make geth
9+
10+
echo "running geth..."
11+
./build/bin/geth > tgeth.log 2>&1 &
12+
13+
GETH_PID=$!
14+
15+
echo "sleeping for $SLEEP_TIME seconds"
16+
17+
sleep $SLEEP_TIME
18+
19+
echo "killing GETH (pid=$GETH_PID)"
20+
kill $GETH_PID
21+
echo "boom"
22+
23+
wait $GETH_PID
24+
25+
GETH_STATUS=$?
26+
echo "The exit status of the process was $GETH_STATUS"
27+
28+
exit $GETH_STATUS

0 commit comments

Comments
 (0)