diff --git a/.github/workflows/example_test.yml b/.github/workflows/example_test.yml new file mode 100644 index 0000000..5ae4dbe --- /dev/null +++ b/.github/workflows/example_test.yml @@ -0,0 +1,30 @@ +on: + push: + +name: test example + +jobs: + run-example-test-plans: + name: "Run example plan" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Setup testground + uses: "libp2p/test-plans/.github/actions/setup-testground@master" + + - uses: actions/checkout@v2 + + - name: Import the plan + run: testground plan import --name simple_tcp_ping --from examples/simple_tcp_ping + + - name: Build the composition + env: + SdkGitRef: ${{ github.GITHUB_SHA }} + run: testground build composition -f examples/simple_tcp_ping/simple_composition.toml --wait + + - name: Run the composition + env: + SdkGitRef: ${{ github.GITHUB_SHA }} + run: testground run composition -f examples/simple_tcp_ping/simple_composition.toml --wait diff --git a/examples/simple_tcp_ping/Dockerfile b/examples/simple_tcp_ping/Dockerfile index 0f17936..711caa8 100644 --- a/examples/simple_tcp_ping/Dockerfile +++ b/examples/simple_tcp_ping/Dockerfile @@ -2,7 +2,8 @@ FROM nimlang/nim:alpine as builder # "checkpoint" to avoid installing dependencies every time # this is optional -RUN nimble install -y "https://github.com/status-im/testground-nim-sdk" +ARG SDK_GIT_REF="master" +RUN nimble install -y "https://github.com/status-im/testground-nim-sdk@#${SDK_GIT_REF}" FROM builder COPY . . diff --git a/examples/simple_tcp_ping/simple_composition.toml b/examples/simple_tcp_ping/simple_composition.toml new file mode 100644 index 0000000..90ba5f8 --- /dev/null +++ b/examples/simple_tcp_ping/simple_composition.toml @@ -0,0 +1,28 @@ +[metadata] + name = 'simple_tcp_ping' + author = "" + +[global] + plan = "simple_tcp_ping" + case = "simple_tcp_ping" + total_instances = 0 + builder = "docker:generic" + runner = "local:docker" + disable_metrics = false + +[[groups]] + id = "a" + builder = "docker:generic" + [groups.resources] + memory = "" + cpu = "" + [groups.instances] + count = 2 + percentage = 0.0 + [groups.build_config] + enabled = true + [groups.build_config.build_args] + SDK_GIT_REF = '{{ or $.Env.SdkGitRef "master" }}' + [groups.build] + [groups.run] + artifact = ""