Skip to content

Commit fdb03c8

Browse files
Refactor CI workflows: remove main.yml, add releae.yml, sync-test.yml, and sync.yml for improved release and sync testing
1 parent b0b6b0b commit fdb03c8

File tree

5 files changed

+131
-60
lines changed

5 files changed

+131
-60
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 40 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+
consensus_client:
6+
description: "Consensus Client"
7+
required: true
8+
type: choice
9+
options: [lodestar, teku, prysm, nimbus, lighthouse]
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 CONSENSUS_CLIENT=${{ github.event.inputs.consensus_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/snapshot_check.yml

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

.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+
consensus_client:
7+
description: "Consensus Client"
8+
required: true
9+
type: choice
10+
options: [lodestar, teku, prysm, nimbus, lighthouse]
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 EXECUTION_CLIENT='reth' -e IPFS_HASH=${{ needs.build.outputs.ipfs_hash }} -e CONSENSUS_CLIENT=${{ github.event.inputs.consensus_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

.github/workflows/sync.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Execution Client Sync Production
2+
3+
on:
4+
schedule:
5+
- cron: "0 5 * * *"
6+
workflow_dispatch:
7+
inputs:
8+
consensus_client:
9+
description: "Consensus Client"
10+
required: true
11+
type: choice
12+
options: [lodestar, teku, prysm, nimbus, lighthouse]
13+
14+
jobs:
15+
sync:
16+
runs-on: staking-test-hoodi
17+
steps:
18+
- name: Run sync
19+
run: |
20+
docker run --rm --pull=always --network dncore_network \
21+
-v /var/run/docker.sock:/var/run/docker.sock \
22+
-e MODE=sync \
23+
-e EXECUTION_CLIENT='reth' \
24+
-e CONSENSUS_CLIENT=${{ github.event.inputs.consensus_client }} \
25+
-e NETWORK=hoodi \
26+
ghcr.io/dappnode/staker-test-util/test-runner:latest

0 commit comments

Comments
 (0)