diff --git a/.github/actions/sandbox/.gitignore b/.github/actions/sandbox/.gitignore new file mode 100644 index 0000000000..17372bd8ab --- /dev/null +++ b/.github/actions/sandbox/.gitignore @@ -0,0 +1 @@ +devnet diff --git a/.github/actions/sandbox/action.yaml b/.github/actions/sandbox/action.yaml index eb30281884..5ed70b301d 100644 --- a/.github/actions/sandbox/action.yaml +++ b/.github/actions/sandbox/action.yaml @@ -1,13 +1,40 @@ name: 'Start Kadena sandbox' +description: 'Start a Kadena Devnet environment using docker-compose with indexer components' runs: using: 'composite' steps: + - name: Checkout repository + uses: actions/checkout@v4 # Use the latest version + with: + repository: 'kadena-io/devnet' + path: 'devnet' + ref: 'ag/kadena-js-devnet' + - name: Start sandbox shell: bash - run: docker compose up -d - working-directory: .github/actions/sandbox + working-directory: ./devnet + # git clone --depth=1 -b ag/kadena-js-devnet git@github.com:kadena-io/devnet.git + run: docker compose -f docker-compose.kadenajs.yaml up -d --quiet-pull + + # TODO: add health check, this one's for kadena/devnet not for hackachain indexer + # - name: Check sandbox health + # shell: bash + # run: ./healthcheck.sh - - name: Check sandbox health + - name: Collect docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + with: + dest: './logs' + + - name: Tar logs + if: failure() shell: bash - run: ./healthcheck.sh - working-directory: .github/actions/sandbox + run: tar cvzf ./logs.tgz ./logs + + - name: Upload logs to GitHub + if: failure() + uses: actions/upload-artifact@master + with: + name: docker_logs.tgz + path: ./logs.tgz diff --git a/.github/actions/sandbox/docker-compose.yaml b/.github/actions/sandbox/docker-compose.yaml deleted file mode 100644 index 98de096877..0000000000 --- a/.github/actions/sandbox/docker-compose.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: '3' -services: - devnet: - image: kadena/devnet:latest - ports: - - 1848:1848 # Node Service Port - - 1789:1789 # Chainweb node’s p2p API port - - 1790:1790 # On-Demand Mining API - - 5432:5432 # Postgres - - 8080:8080 # HTTP - - 9999:9999 # Info - environment: - - MINING_BATCH_PERIOD=0.05 - - MINING_IDLE_PERIOD=2 - - MINING_CONFIRMATION_PERIOD=1 - volumes: - - ../../../packages/apps/graph/cwd-extra-migrations:/cwd-extra-migrations:ro - - sandbox:/data -volumes: - sandbox: diff --git a/.github/actions/sandbox/healthcheck.sh b/.github/actions/sandbox/healthcheck.sh old mode 100755 new mode 100644 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d50b0e91b..da49216d5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,11 @@ jobs: fetch-depth: 2 show-progress: false +# moved this to the top for testing + - name: Setup Kadena sandbox + uses: ./.github/actions/sandbox +# remove to above when done testing + - name: Runner setup uses: ./.github/actions/runner-setup diff --git a/.prettierignore b/.prettierignore index 30260aad7a..074fb1935b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,3 +3,4 @@ .github/actions !.changeset pnpm-lock.yaml +devnet