Skip to content

Commit

Permalink
Refactor all zombienet actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpolaczyk committed Jul 24, 2024
1 parent e207c14 commit c4a3daa
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 321 deletions.
63 changes: 63 additions & 0 deletions .github/workflow-templates/zombienet-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Zombienet Tests
description: |
Downloads tanssi binaries compiled in previous step, and executes zombienet test suite using moonwall.
Uploads zombienet logs as an artifact in case of failure.
inputs:
test_name:
description: Zombienet suite to run
required: true

runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/tanssi-relay tanssi-relay-prepare-worker tanssi-relay-execute-worker
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test ${{ inputs.test_name }}
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ inputs.test_name }}
path: logs
279 changes: 7 additions & 272 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,222 +552,14 @@ jobs:
zombienet-tests:
runs-on: self-hosted
needs: ["set-tags", "build"]
strategy:
matrix:
test_name: [zombie_tanssi, zombie_tanssi_parathreads, zombie_tanssi_rotation, zombie_tanssi_warp_sync, zombie_tanssi_relay]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs
path: logs

zombienet-tests-parathreads:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_parathreads
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-parathreads
path: logs

zombienet-tests-rotation:
runs-on: self-hosted
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_rotation
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-rotation
path: logs

zombienet-tests-warp-sync:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_warp_sync
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-warp-sync
path: logs
- name: Run Zombienet Test ${{ matrix.test_name }}
uses: ./.github/workflow-templates/zombienet-tests/action.yml
with:
test_name: ${{ matrix.test_name }}

chopsticks-upgrade-test:
runs-on:
Expand Down Expand Up @@ -937,63 +729,6 @@ jobs:
pnpm install
pnpm moonwall test zombie_${{ matrix.chains.chain }}_upgrade
zombienet-tests-tanssi-relay:
runs-on: self-hosted
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/tanssi-relay
chmod uog+x target/release/tanssi-relay-execute-worker
chmod uog+x target/release/tanssi-relay-prepare-worker
chmod uog+x target/release/container-chain-simple-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_relay
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-tanssi-relay
path: logs

docker-tanssi:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
Expand Down
Loading

0 comments on commit c4a3daa

Please sign in to comment.