Skip to content

Commit

Permalink
Fix Grid Nightly workflow (#3274)
Browse files Browse the repository at this point in the history
* Push workflow

* Update workflow, add issue template

* test workflow

* Update search_existing

* add update_existing

* Edit workflow

* Edit workflow to get title from env file

* Add issue title env

* test duplication

* Edit nightly, comment issue creation, edit issue template

* Edit checkout version

* Checkout repo b4 creating an issue

* Edit body

* Edit nightly

* test envs in issue template

* Search issues before create new one

* add token to find issues

* Edit workflow url, remove unused files

* Enforce running all jobs, fix run url

* Edit nightly

* add all networks

* Test failed test

* Replace continue-on-err w if:always()

* Final test

* Run a cron job instead on push

* Edit branches in all actions, remove jq installation

* Fail on purpuse

* Revert cron job
  • Loading branch information
zaelgohary authored Aug 13, 2024
1 parent 457da79 commit ce2ca59
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 75 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ name: Full Clients Build

on:
push:
branches: [development, development_2.6]
branches:
- development
pull_request:
branches: [development, development_2.6]
branches:
- development

jobs:
build:
Expand Down
113 changes: 46 additions & 67 deletions .github/workflows/grid_client_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: read
issues: write

jobs:
deployment-scripts:
runs-on: ubuntu-latest
Expand All @@ -22,17 +26,6 @@ jobs:

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

Expand All @@ -45,56 +38,62 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y git libtool tmux redis net-tools
sudo apt-get install -y git libtool tmux redis net-tools gh
- name: Install
run: |
yarn
lerna run build --no-private
make build
- name: Run test dynamic single vm
id: dynamicsinglevm
continue-on-error: true
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: multiplevm
continue-on-error: true
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: kubernetes
continue-on-error: true
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
continue-on-error: true
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: kubernetesqsfs
continue-on-error: true
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
continue-on-error: true
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
continue-on-error: true
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: deleteall
if: always()
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
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
Expand All @@ -111,53 +110,33 @@ jobs:
exit 1
fi
- name: Test Results
- name: Find issues
if: failure()
id: find-issues
env:
GH_TOKEN: ${{ github.token }}
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
if: |
steps.dynamicsinglevm.outcome != 'success' ||
steps.multiplevm.outcome != 'success' ||
steps.kubernetes.outcome != 'success' ||
steps.vmqsfs.outcome != 'success' ||
steps.kubernetesqsfs.outcome != 'success' ||
steps.kvstore.outcome != 'success' ||
steps.zdb.outcome != 'success' ||
steps.deleteall.outcome != 'success'
run: exit 1
ISSUE_COUNT=$(gh issue list --search "${{github.workflow}} failed during schedule on ${{ env.NETWORK }}" --json title --jq '. | length')
echo "issue_count=$ISSUE_COUNT" >> $GITHUB_ENV
- name: Create GitHub Issue on Failure
if: failure() && '$(date +%u)' != '5' && '$(date +%u)' != '6'
if: failure() && env.issue_count == '0'
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: |
${{ github.workflow }} failed during ${{ github.event_name }} on network ${{ env.NETWORK }}
title: ${{github.workflow}} failed during schedule on ${{ env.NETWORK }}
body: |
## Failure Report:
## 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 }}
> **Details on failed run**: 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
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ name: Full Clients Lint

on:
push:
branches: [development, development_2.6]
branches:
- development
pull_request:
branches: [development, development_2.6]
branches:
- development

jobs:
lint:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/playground_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
push:
branches:
- development
- development_2.6
paths:
- "packages/playground/**"
pull_request:
branches:
- development
- development_2.6
paths:
- "packages/playground/**"

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/yarn_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: Full Clients Audit

on:
push:
branches: [development, development_2.6]
branches:
- development
pull_request:
branches: [development, development_2.6]
branches:
- development

jobs:
audit-and-open-issue:
Expand Down

0 comments on commit ce2ca59

Please sign in to comment.