Skip to content

Playground operation check #394

Playground operation check

Playground operation check #394

name: Playground operation check
on:
workflow_dispatch:
schedule:
# Run this job once per day
- cron: "0 0 * * *"
jobs:
playground-check:
runs-on: ubuntu-latest
env:
FORK_URL_MAINNET: ${{ secrets.FORK_URL_MAINNET }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install dependency
run: sudo apt-get -qq update && sudo apt-get -y -q install curl jq
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
- name: Setup environment
run: |
cp playground/.env.example playground/.env
sed -i -e 's/ETH_RPC_URL=.*/ETH_RPC_URL=$FORK_URL_MAINNET/g' playground/.env
cat playground/.env
- name: Start docker containers
working-directory: playground
run: |
# firstly start explorer container to workaround yarn cache problem
docker compose -f docker-compose.fork.yml up -d explorer
docker compose -f docker-compose.fork.yml up -d
- name: Execute validation script
working-directory: playground
run: ./test_playground.sh
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@2741064ab9d7af54b0b1ffb6076cf64c16f0220e # v2.2.2
with:
dest: './logs'
- name: Collect playground-chain-1 container health logs on failure
if: failure()
run: docker inspect --format='{{json .State.Health}}' playground-chain-1 > ./logs/playground-chain-1-health-log.json
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
id: artifact-upload-step
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: logs.tgz
path: ./logs.tgz
- name: Slack notification on failure
if: failure()
id: slack
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
payload: |
{
"channel_id": "C037PB929ME",
"job_link":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"actor":"${{ github.actor }}",
"event_name":"${{ github.event_name }}",
"head_ref":"${{ github.head_ref }}",
"step_containers":"${{ steps.containers.conclusion }}",
"step_test_script":"${{ steps.test_script.conclusion }}",
"log_artifcat":"${{ steps.artifact-upload-step.outputs.artifact-url }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PLAYGROUND_CI_WEBHOOK_URL }}