Skip to content

Commit fb47f46

Browse files
refactor: replace main.yml with releae.yml and add sync-test.yml for improved CI workflows
1 parent eaf6837 commit fb47f46

3 files changed

Lines changed: 105 additions & 43 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎.github/workflows/releae.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
execution_client:
6+
description: "Execution Client"
7+
required: true
8+
type: choice
9+
options: ["geth", "nethermind", "besu", "erigon", "reth"]
10+
push:
11+
branches:
12+
- "main"
13+
paths-ignore:
14+
- "README.md"
15+
16+
jobs:
17+
build:
18+
runs-on: staking-test-hoodi
19+
name: Build
20+
outputs:
21+
ipfs_hash: ${{ steps.extract_hash.outputs.ipfs_hash }}
22+
steps:
23+
- uses: actions/checkout@v6
24+
- name: Build and upload
25+
run: npx @dappnode/dappnodesdk build --provider=http://$(docker inspect DAppNodeCore-ipfs.dnp.dappnode.eth --format '{{.NetworkSettings.Networks.dncore_network.IPAddress}}'):5001 --variant=hoodi
26+
- name: Extract IPFS hash from releases.json
27+
id: extract_hash
28+
run: |
29+
# Get the last key's hash from releases.json
30+
IPFS_HASH=$(jq -r 'to_entries | last | .value.hash' package_variants/hoodi/releases.json)
31+
echo "ipfs_hash=$IPFS_HASH" >> $GITHUB_OUTPUT
32+
echo "Extracted IPFS hash: $IPFS_HASH"
33+
34+
test:
35+
name: Test
36+
runs-on: staking-test-hoodi
37+
needs: [build]
38+
steps:
39+
- uses: actions/checkout@v6
40+
- name: Run staker test runner
41+
run: |
42+
docker run --rm --pull=always \
43+
--network dncore_network -e EXECUTION_CLIENT=${{ github.event.inputs.execution_client }} \
44+
-v /var/run/docker.sock:/var/run/docker.sock \
45+
-e MODE=test -e IPFS_HASH=${{ needs.build.outputs.ipfs_hash }} \
46+
-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 }} \
47+
ghcr.io/dappnode/staker-test-util/test-runner:latest
48+
49+
release:
50+
name: Release
51+
runs-on: ubuntu-latest
52+
needs: [test]
53+
steps:
54+
- uses: actions/checkout@v6
55+
- name: Publish
56+
run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset --timeout 2h --all-variants
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1"

‎.github/workflows/sync-test.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Execution Client Sync Test
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
execution_client:
7+
description: "Execution Client"
8+
required: true
9+
type: choice
10+
options: ["geth", "nethermind", "besu", "erigon", "reth"]
11+
pull_request:
12+
branches:
13+
- "main"
14+
paths-ignore:
15+
- "README.md"
16+
17+
jobs:
18+
build:
19+
runs-on: staking-test-hoodi
20+
name: Build
21+
outputs:
22+
ipfs_hash: ${{ steps.extract_hash.outputs.ipfs_hash }}
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: Build and upload
26+
run: npx @dappnode/dappnodesdk build --provider=http://$(docker inspect DAppNodeCore-ipfs.dnp.dappnode.eth --format '{{.NetworkSettings.Networks.dncore_network.IPAddress}}'):5001 --variant=hoodi
27+
- name: Extract IPFS hash from releases.json
28+
id: extract_hash
29+
run: |
30+
# Get the last key's hash from releases.json
31+
IPFS_HASH=$(jq -r 'to_entries | last | .value.hash' package_variants/hoodi/releases.json)
32+
echo "ipfs_hash=$IPFS_HASH" >> $GITHUB_OUTPUT
33+
echo "Extracted IPFS hash: $IPFS_HASH"
34+
35+
sync-test:
36+
runs-on: staking-test-hoodi
37+
name: Execution Client Sync Test
38+
needs: [build]
39+
steps:
40+
- name: Run sync
41+
run: |
42+
docker run --rm --pull=always --network dncore_network \
43+
-v /var/run/docker.sock:/var/run/docker.sock \
44+
-e MODE=sync -e CONSENSUS_CLIENT='lighthouse' -e IPFS_HASH=${{ needs.build.outputs.ipfs_hash }} -e EXECUTION_CLIENT=${{ github.event.inputs.execution_client }} \
45+
-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 }} \
46+
ghcr.io/dappnode/staker-test-util/test-runner:latest

0 commit comments

Comments
 (0)