Skip to content

Edit nightly

Edit nightly #561

# This workflow will install needed dependencies and run main grid tests.
name: Grid Client Nightly
# on:
# schedule:
# - cron: "0 4 * * *"
# workflow_dispatch:
on:
push:
branches:
- development_issue_creation
permissions:
contents: read
issues: write
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' }} || ${{ env.NETWORK == 'qa' }} || ${{ env.NETWORK == 'test' }} || ${{ 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 jq gh
- name: Install
run: |
yarn
make build
- name: Run test dynamic single vm
id: single_vm
if: always()
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts
- name: Run test multiple vms
id: multiple_vm
if: always()
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/multiple_vms.ts
- name: Run test kubernetes
id: k8s
if: always()
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
if: always()
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: k8sqsfs
if: always()
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
if: always()
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
if: always()
run: |
yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/zdb.ts
- name: Cleanup - Delete all contracts
id: delete_all
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
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.single_vm.outcome }}
echo Multiple Vm: ${{ steps.multiple_vm.outcome }}
echo Kubernetes: ${{ steps.k8s.outcome }}
echo Vmq Qsfs: ${{ steps.vmqsfs.outcome }}
echo Kubernetes Qsfs: ${{ steps.k8sqsfs.outcome }}
echo Kvstore: ${{ steps.kvstore.outcome }}
echo Zdb: ${{ steps.zdb.outcome }}
echo Delete all contracts: ${{ steps.delete_all.outcome }}
- name: Check test script status
if: |
steps.single_vm.outcome != 'success' ||
steps.multiple_vm.outcome != 'success' ||
steps.k8s.outcome != 'success' ||
steps.vmqsfs.outcome != 'success' ||
steps.k8sqsfs.outcome != 'success' ||
steps.kvstore.outcome != 'success' ||
steps.zdb.outcome != 'success' ||
steps.delete_all.outcome != 'success'
run: exit 1
- name: Checkout repository again
uses: actions/checkout@v3
- name: Search for Existing Issues
id: search_issues
run: |
ISSUE_TITLE="Grid Nightly failed during schedule on ${{ env.NETWORK }}"
REPO="${{ github.repository }}"
SEARCH_RESULT=$(gh issue list --repo "$REPO" --search "$ISSUE_TITLE" --json title --jq '.[] | select(.title == "'$ISSUE_TITLE'") | .title')
if [ -n "$SEARCH_RESULT" ]; then
echo "issue_exists=true" >> $GITHUB_ENV
else
echo "issue_exists=false" >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Issue on Failure
if: failure() && ${{ env.issue_exists == 'false' }}
uses: dacbd/create-issue-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Grid Nightly failed during schedule on ${{ env.NETWORK }}
body: |
## Failure Report
**Details on failed run**: [View Run Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
- **Dynamic Single Vm**: ${{ steps.single_vm.outcome }}
- **Multiple Vm**: ${{ steps.multiple_vm.outcome }}
- **Kubernetes**: ${{ steps.k8s.outcome }}
- **Vmq QSFS**: ${{ steps.vmqsfs.outcome }}
- **Kubernetes QSFS**: ${{ steps.k8sqsfs.outcome }}
- **Kvstore**: ${{ steps.kvstore.outcome }}
- **Zdb**: ${{ steps.zdb.outcome }}
- **Delete all contracts**: ${{ steps.delete_all.outcome }}
labels: type_bug, grid_client