Skip to content

Commit

Permalink
add mainnet joining action
Browse files Browse the repository at this point in the history
  • Loading branch information
chmllr committed Oct 29, 2024
1 parent 4ff3a6c commit dc54054
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci-join-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: join mainnet nightly
# Nightly action that tests joining mainnet as a full node.

on:
workflow_dispatch:
schedule:
- cron: "0 1 * * 1-5" # Weekdays at 1am UTC

permissions:
contents: read
pull-requests: read

jobs:
join:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'

- name: Build binaries
uses: goreleaser/goreleaser-action@v5
with:
version: 2
args: release -f .goreleaser-snapshot.yaml --snapshot --clean --skip=archive

- name: Build halovisor image
run: scripts/halovisor/build.sh "${GITHUB_SHA::7}"

- name: Run join test
run: |
cd scripts/join
go test . -v --network=mainnet --integration --logs_file=docker_logs.txt -timeout 0
- name: Upload docker logs
uses: actions/upload-artifact@v4
if: always()
with:
name: failed-logs
path: scripts/join/docker_logs.txt
retention-days: 3
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: join omega nightly
# Nightly action that tests joining omega as a full node.

on:
workflow_dispatch:
schedule:
- cron: "0 1 * * 1-5" # Weekdays at 1am UTC
# We temporarily disable this action because it fails and needs to be investigated
# on:
# workflow_dispatch:
# schedule:
# - cron: "0 1 * * 1-5" # Weekdays at 1am UTC

permissions:
contents: read
Expand Down
8 changes: 4 additions & 4 deletions scripts/join/join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ import (

var (
logsFile = flag.String("logs_file", "join_test.log", "File to write docker logs to")
network = flag.String("network", "omega", "Network to join (default: omega)")
integration = flag.Bool("integration", false, "Run integration tests")
)

// TestJoinOmega starts a local node (using omni operator init-nodes)
// TestJoinNetwork starts a local node (using omni operator init-nodes)
// and waits for it to sync.
//
//nolint:paralleltest // Parallel tests not supported since we start docker containers.
func TestJoinOmega(t *testing.T) {
func TestJoinNetwork(t *testing.T) {
if !*integration {
t.Skip("skipping integration test")
}
Expand All @@ -47,7 +48,6 @@ func TestJoinOmega(t *testing.T) {
minDuration = time.Minute * 30
)

network := netconf.Omega
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
home := t.TempDir()
Expand All @@ -57,7 +57,7 @@ func TestJoinOmega(t *testing.T) {
require.NoError(t, err)

cfg := clicmd.InitConfig{
Network: network,
Network: netconf.ID(*network),
Home: home,
Moniker: t.Name(),
HaloTag: getGitCommit7(t),
Expand Down

0 comments on commit dc54054

Please sign in to comment.