Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/staking-attestation-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Staking Attestation Test

on:
workflow_call:
inputs:
package_variant:
description: "Package variant to build and test (e.g., hoodi)"
required: false
type: string
default: "hoodi"
consensus_client:
description: "Consensus client override"
required: false
type: string
default: ""
execution_client:
description: "Execution client override"
required: false
type: string
default: ""
runner_label:
description: "Self-hosted runner label"
required: false
type: string
default: "staking-test-hoodi"
pr_number:
description: "PR number to report results on"
required: false
type: string
default: ""
head_ref:
description: "PR head branch ref to checkout"
required: false
type: string
default: ""
sender:
description: "User who triggered the test"
required: false
type: string
default: ""
secrets:
TROPI_APP_PRIVATE_KEY:
required: true

jobs:
build:
runs-on: ${{ inputs.runner_label }}
name: Build Package
outputs:
ipfs_hash: ${{ steps.extract_hash.outputs.ipfs_hash }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.head_ref || github.head_ref || github.ref }}

- uses: actions/setup-node@v6
with:
node-version: "24"

- name: Build and upload to IPFS
run: |
npx @dappnode/dappnodesdk build \
--provider=http://$(docker inspect DAppNodeCore-ipfs.dnp.dappnode.eth --format '{{.NetworkSettings.Networks.dncore_network.IPAddress}}'):5001 \
--variant=${{ inputs.package_variant }}

- name: Extract IPFS hash
id: extract_hash
run: |
IPFS_HASH=$(jq -r 'to_entries | last | .value.hash' package_variants/${{ inputs.package_variant }}/releases.json)
echo "ipfs_hash=$IPFS_HASH" >> $GITHUB_OUTPUT
echo "Extracted IPFS hash: $IPFS_HASH"

attestation-test:
runs-on: ${{ inputs.runner_label }}
name: Proof of Attestation
needs: [build]
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ vars.TROPI_APP_ID }}
private-key: ${{ secrets.TROPI_APP_PRIVATE_KEY }}

- name: Run attestation test
env:
PR_NUMBER: ${{ inputs.pr_number || github.event.pull_request.number || github.event.number }}
run: |
docker run --rm --pull=always --network dncore_network \
-v /var/run/docker.sock:/var/run/docker.sock \
-e MODE=attestation \
-e IPFS_HASH=${{ needs.build.outputs.ipfs_hash }} \
-e EXECUTION_CLIENT=${{ inputs.execution_client }} \
-e CONSENSUS_CLIENT=${{ inputs.consensus_client }} \
-e GITHUB_TOKEN=${{ steps.app-token.outputs.token }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_PR_NUMBER=${PR_NUMBER} \
-e GITHUB_RUN_ID=${{ github.run_id }} \
-e GITHUB_SERVER_URL=${{ github.server_url }} \
dappnode/tropibot:latest test-runner