diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index b0d8f71..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: "Main" -on: - pull_request: - push: - branches: - - "master" - - "main" - - "v[0-9]+.[0-9]+.[0-9]+" - paths-ignore: - - "README.md" - -jobs: - build-test: - runs-on: ubuntu-latest - name: Build test - if: github.event_name != 'push' - steps: - - uses: actions/checkout@v4 - - run: npx @dappnode/dappnodesdk build --skip_save --variant mainnet - - # e2e-test: - # runs-on: mainnet - # needs: build-test - # if: github.event_name != 'push' - # name: End to end tests - # steps: - # - uses: actions/checkout@v4 - # - run: npx @dappnode/dappnodesdk@latest github-action test-end-to-end --errorLogsTimeout 120 --healthCheckUrl http://beacon-chain.lighthouse.dappnode:3500/eth/v1/beacon/genesis --network mainnet --environmentByService="{\"beacon-chain\":{\"CHECKPOINT_SYNC_URL\":\"https://checkpoint-sync.dappnode.io\"}}" - - release: - name: Release - runs-on: ubuntu-latest - if: github.event_name == 'push' - steps: - - uses: actions/checkout@v3 - - name: Publish - run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset --all-variants - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1" diff --git a/.github/workflows/releae.yml b/.github/workflows/releae.yml new file mode 100644 index 0000000..65787af --- /dev/null +++ b/.github/workflows/releae.yml @@ -0,0 +1,62 @@ +name: "Release" +on: + workflow_dispatch: + inputs: + execution_client: + description: "Execution Client" + required: true + type: choice + options: ["geth", "nethermind", "besu", "erigon", "reth"] + push: + branches: + - "main" + paths-ignore: + - "README.md" + +jobs: + build: + runs-on: staking-test-hoodi + name: Build + outputs: + ipfs_hash: ${{ steps.extract_hash.outputs.ipfs_hash }} + steps: + - uses: actions/checkout@v6 + - name: Build and upload + run: npx @dappnode/dappnodesdk build --provider=http://$(docker inspect DAppNodeCore-ipfs.dnp.dappnode.eth --format '{{.NetworkSettings.Networks.dncore_network.IPAddress}}'):5001 --variant=hoodi + - name: Extract IPFS hash from releases.json + id: extract_hash + run: | + # Get the last key's hash from releases.json + IPFS_HASH=$(jq -r 'to_entries | last | .value.hash' package_variants/hoodi/releases.json) + echo "ipfs_hash=$IPFS_HASH" >> $GITHUB_OUTPUT + echo "Extracted IPFS hash: $IPFS_HASH" + + test: + name: Test + runs-on: staking-test-hoodi + needs: [build] + steps: + - uses: actions/checkout@v6 + - name: Run staker test runner + run: | + docker run --rm --pull=always \ + --network dncore_network -e EXECUTION_CLIENT=${{ github.event.inputs.execution_client }} \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e MODE=test -e IPFS_HASH=${{ needs.build.outputs.ipfs_hash }} \ + -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} -e GITHUB_REPOSITORY=${{ github.repository }} -e GITHUB_PR_NUMBER=${{ github.event.pull_request.number }} -e GITHUB_RUN_ID=${{ github.run_id }} -e GITHUB_SERVER_URL=${{ github.server_url }} \ + ghcr.io/dappnode/staker-test-util/test-runner:latest + + release: + name: Release + runs-on: ipfs-dev-gateway + needs: [test] + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: "22" + - name: Publish + run: npx @dappnode/dappnodesdk publish patch --content_provider=http://10.200.200.7:5001 --eth_provider=https://web3.dappnode.net --timeout 2h --all-variants + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1" diff --git a/.github/workflows/sync-test.yml b/.github/workflows/sync-test.yml new file mode 100644 index 0000000..e7b532f --- /dev/null +++ b/.github/workflows/sync-test.yml @@ -0,0 +1,46 @@ +name: Execution Client Sync Test + +on: + workflow_dispatch: + inputs: + execution_client: + description: "Execution Client" + required: true + type: choice + options: ["geth", "nethermind", "besu", "erigon", "reth"] + pull_request: + branches: + - "main" + paths-ignore: + - "README.md" + +jobs: + build: + runs-on: staking-test-hoodi + name: Build + outputs: + ipfs_hash: ${{ steps.extract_hash.outputs.ipfs_hash }} + steps: + - uses: actions/checkout@v6 + - name: Build and upload + run: npx @dappnode/dappnodesdk build --provider=http://$(docker inspect DAppNodeCore-ipfs.dnp.dappnode.eth --format '{{.NetworkSettings.Networks.dncore_network.IPAddress}}'):5001 --variant=hoodi + - name: Extract IPFS hash from releases.json + id: extract_hash + run: | + # Get the last key's hash from releases.json + IPFS_HASH=$(jq -r 'to_entries | last | .value.hash' package_variants/hoodi/releases.json) + echo "ipfs_hash=$IPFS_HASH" >> $GITHUB_OUTPUT + echo "Extracted IPFS hash: $IPFS_HASH" + + sync-test: + runs-on: staking-test-hoodi + name: Execution Client Sync Test + needs: [build] + steps: + - name: Run sync + run: | + docker run --rm --pull=always --network dncore_network \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e MODE=sync -e CONSENSUS_CLIENT='lighthouse' -e IPFS_HASH=${{ needs.build.outputs.ipfs_hash }} -e EXECUTION_CLIENT=${{ github.event.inputs.execution_client }} \ + -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} -e GITHUB_REPOSITORY=${{ github.repository }} -e GITHUB_PR_NUMBER=${{ github.event.pull_request.number }} -e GITHUB_RUN_ID=${{ github.run_id }} -e GITHUB_SERVER_URL=${{ github.server_url }} \ + ghcr.io/dappnode/staker-test-util/test-runner:latest