libp2p-test-plans/.github/actions/setup-testground/action.yml

82 lines
2.4 KiB
YAML
Raw Normal View History

name: start testground
description: setup a local testground instance
inputs:
testground_endpoint:
required: false
default: ''
testground_repository:
required: false
default: 'testground/testground'
testground_ref:
required: false
default: 'edge'
runs:
using: "composite"
steps:
# Default setup when we use the testground_ref == edge.
- name: Load testground
if: ${{ inputs.testground_ref == 'edge' }}
shell: bash
run: |
for i in 1 2 3; do
echo "=== Attempt $i ==="
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/testground/testground/master/install.sh)" && \
exit 0
sleep 10
done
exit 1
# Custom setup (slower) when we use a different testground_ref
- name: Checkout testground
if: ${{ inputs.testground_ref != 'edge' }}
uses: actions/checkout@v2
with:
path: testground
repository: ${{ inputs.testground_repository }}
ref: ${{ inputs.testground_ref }}
- name: Setup Go
if: ${{ inputs.testground_ref != 'edge' }}
uses: actions/setup-go@v3
with:
cache: true
go-version-file: 'testground/go.mod'
cache-dependency-path: testground/go.sum
- name: Install testground
if: ${{ inputs.testground_ref != 'edge' }}
run: make install || make install || make install # 3 retries in case of network drops.
working-directory: testground
shell: bash
- name: Run the daemon or configure the client
shell: bash
env:
TESTGROUND_ENDPOINT: ${{ inputs.testground_endpoint }}
run: |
if [[ ! -z "${TESTGROUND_ENDPOINT}" ]]; then
mkdir -p ~/testground/;
cat <<EOF >> ~/testground/.env.toml
[client]
endpoint = "${TESTGROUND_ENDPOINT}"
EOF
else
mkdir -p ~/testground/;
cat <<EOF >> ~/testground/.env.toml
[daemon.scheduler]
ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
task_timeout_min = 60
EOF
testground daemon > testground.out 2> testground.err &
fi;
- name: Check testground daemon health
run:
echo "Waiting for Testground to launch on 8042...";
while ! nc -z localhost 8042; do
sleep 1;
done;
echo "Testground launched";
testground healthcheck --runner local:docker --fix;
shell: bash