Skip to content

Grid Client Nightly #555

Grid Client Nightly

Grid Client Nightly #555

# This workflow will install needed dependencies and run main grid tests.
name: Grid Client Nightly
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
jobs:
deployment-scripts:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
network: ["dev", "qa", "test", "main"]
env:
NETWORK: ${{ matrix.network }}
RMB_PROXY: true
STORE_SECRET: secret
MNEMONIC: ${{ secrets.MNEMONIC }}
SSH_KEY: ${{ secrets.SSH_KEY }}
steps:
- uses: actions/checkout@v4
if: ${{ env.NETWORK == 'dev' }}
- uses: actions/checkout@v4
if: ${{ env.NETWORK == 'qa' }}
with:
ref: refs/tags/v2.5.2
- uses: actions/checkout@v4
if: ${{ env.NETWORK == 'test' }}
with:
ref: refs/tags/v2.5.2
- uses: actions/checkout@v4
if: ${{ env.NETWORK == 'main' }}
with:
ref: refs/tags/v2.5.2
- name: Set up node 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y git libtool tmux redis net-tools
- name: Install
run: |
yarn
lerna run build --no-private
- name: Run test dynamic single vm
id: dynamicsinglevm
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tscon
g-node.json packages/grid_client/scripts/dynamic_single_vm.ts
- name: Run test multiple vms
id: multiplevm
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/multiple_vms.ts
- name: Run test kubernetes
id: kubernetes
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_leader.ts
- name: Run test vm with qsfs
id: vmqsfs
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/vm_with_qsfs.ts
- name: Run test kubernetes with qsfs
id: kubernetesqsfs
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts
- name: Run test kvstore
id: kvstore
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kvstore_example.ts
- name: Run test zdb
id: zdb
continue-on-error: true
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/zdb.ts
- name: Cleanup - Delete all contracts
id: deleteall
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/delete_all_contracts.ts
- name: Run check up - List all contracts
id: command_step
run: |
sleep 15
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/list_all_contracts.ts > output.txt
- name: Check if contracts are Empty
run: |
# print the file content
cat output.txt
# Check if Node contracts are empty
if grep -q "nodeContracts: \[\]" output.txt && ! grep -q "nodeContracts: \[[[:space:]]*\]" output.txt; then
echo "Deletion failed; The Node Contract is not empty."
# Print the contract that couldn't be deleted
exit 1
fi
- name: Test Results
run: |
echo Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }}
echo Multiple Vm: ${{ steps.multiplevm.outcome }}
echo Kubernetes: ${{ steps.kubernetes.outcome }}
echo Vmq Qsfs: ${{ steps.vmqsfs.outcome }}
echo Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }}
echo Kvstore: ${{ steps.kvstore.outcome }}
echo Zdb: ${{ steps.zdb.outcome }}
echo Delete all contracts: ${{ steps.deleteall.outcome }}
- name: Check test script status
id: check_status
run: |
failures=""
if [[ "${{ steps.dynamicsinglevm.outcome }}" != "success" ]]; then
failures="${failures} dynamicsinglevm"
fi
if [[ "${{ steps.multiplevm.outcome }}" != "success" ]]; then
failures="${failures} multiplevm"
fi
if [[ "${{ steps.kubernetes.outcome }}" != "success" ]]; then
failures="${failures} kubernetes"
fi
if [[ "${{ steps.vmqsfs.outcome }}" != "success" ]]; then
failures="${failures} vmqsfs"
fi
if [[ "${{ steps.kubernetesqsfs.outcome }}" != "success" ]]; then
failures="${failures} kubernetesqsfs"
fi
if [[ "${{ steps.kvstore.outcome }}" != "success" ]]; then
failures="${failures} kvstore"
fi
if [[ "${{ steps.zdb.outcome }}" != "success" ]]; then
failures="${failures} zdb"
fi
if [[ "${{ steps.deleteall.outcome }}" != "success" ]]; then
failures="${failures} deleteall"
fi
echo "::set-output name=failures::$failures"
if [[ -n "$failures" ]]; then
echo "Failing tests:${failures}"
exit 1
# - name: Check for Existing Issues
# id: check_issues
# uses: actions/github-script@v6
# with:
# script: |
# const { data: issues } = await github.issues.listForRepo({
# owner: context.repo.owner,
# repo: context.repo.repo,
# state: 'open'
# });
# const issueExists = issues.some(issue => issue.title.includes(`${{ github.workflow }} failed during ${{ github.event_name }} on network ${{ env.NETWORK }}`));
# return issueExists ? 'true' : 'false';
- name: Create GitHub Issue on Failure
if: failure() && '$(date +%u)' != '5' && '$(date +%u)' != '6'
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: |
${{ github.workflow }} failed during ${{ github.event_name }} on network ${{ env.NETWORK }}, failing tests: ${{ steps.check_status.outputs.failures }}
body: |
## Failure Report:
> [!IMPORTANT]
> Details on failed run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Author: @${{ github.triggering_actor }}
- Branch: `${{ github.ref }}`
- Commit: ${{ github.sha }}
- Network: `${{ env.NETWORK }}`
Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }}
Multiple Vm: ${{ steps.multiplevm.outcome }}
Kubernetes: ${{ steps.kubernetes.outcome }}
Vmq Qsfs: ${{ steps.vmqsfs.outcome }}
Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }}
Kvstore: ${{ steps.kvstore.outcome }}
Zdb: ${{ steps.zdb.outcome }}
Delete all contracts: ${{ steps.deleteall.outcome }}
labels: type_bug, grid_client