Skip to content

Commit

Permalink
chore(ci): init supernova
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Apr 19, 2023
1 parent 7dca377 commit b687ea9
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/supernova.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Supernova
on:
push:
branches:
- ci/supernova
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC

jobs:
supernova:
runs-on: ubuntu-latest

permissions:
contents: write

services:
gnoland:
image: ghcr.io/gnolang/gno:latest
# keep the container running
options: --workdir /opt/gno/src/gno.land -it --entrypoint "bash"
ports:
- 26657:26657
- 36657:36657

steps:
- uses: actions/checkout@v3

- name: setup and start gnoland chain
run: |
docker exec ${{ job.services.gnoland.id }} gnoland -skip-start=true
docker exec ${{ job.services.gnoland.id }} sed -i 's#laddr =.*:26657.*#laddr = "tcp://0.0.0.0:26657"#g' testdir/config/config.toml
docker exec -dit ${{ job.services.gnoland.id }} gnoland
- name: install some softwares
run: |
sudo apt-get update -y && sudo apt-get install -y wget curl unzip sudo
- name: download supernova
run: |
export SUPERNOVA_VERSION=1.0.0
wget -c https://github.com/gnolang/supernova/releases/download/v${SUPERNOVA_VERSION}/supernova_${SUPERNOVA_VERSION}_linux_amd64.tar.gz -O - | tar -xz -C /usr/local/bin/
# install supernova scripts
wget -O /tmp/main.zip https://github.com/gnolang/supernova/archive/refs/heads/main.zip
unzip -d /tmp/ /tmp/main.zip
cp -r /tmp/supernova-main/scripts .
- name: run supernova
run: |
curl -v http://localhost:26657/status
supernova -sub-accounts 5 -transactions 100 -url http://localhost:26657 -mnemonic "source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast" -output result.json
- name: archive supernova result
uses: actions/upload-artifact@v3
with:
name: supernova-result.json
path: result.json

- name: Send report to slack \#gno-core-tech
run: |
DATA=$(cat result.json | jq -r )
PAYLOAD="{\"payload\": '$DATA'}"
curl -X POST -H 'Content-type: application/json' --data "$PAYLOAD" $SLACK_WEBHOOK_URL
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_REPORT_SLACK_WEBHOOK }}

- name: move result.json in reports/
run: |
mkdir -p reports/supernova
mv result.json reports/supernova/$(date +"%Y-%m-%d")_report.json
- uses: stefanzweifel/git-auto-commit-action@v4
with:
push_options: '--force'
commit_message: add daily report

0 comments on commit b687ea9

Please sign in to comment.