Skip to content

Commit 81bd360

Browse files
ci: add create cluster Charon parity workflow (#429)
Wires up scripts/create-cluster-compare.sh (added in #388) so the Pluto/Charon create-cluster semantic-equivalence check runs on PRs touching Rust sources, Cargo manifests, the script itself, or the workflow file. Mirrors the dkg-runner workflow: caches a pinned charon v1.7.1 binary, builds pluto-cli, runs the comparison, and uploads the scratch dir on failure. Co-authored-by: Bohdan Ohorodnii <35969035+varex83@users.noreply.github.com>
1 parent c235e84 commit 81bd360

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: create cluster Charon parity
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- "**/*.rs"
8+
- "**/Cargo.toml"
9+
- "Cargo.lock"
10+
- "scripts/create-cluster-compare.sh"
11+
- ".github/workflows/create-cluster-compare.yml"
12+
pull_request:
13+
types: [synchronize, opened, reopened, ready_for_review]
14+
paths:
15+
- "**/*.rs"
16+
- "**/Cargo.toml"
17+
- "Cargo.lock"
18+
- "scripts/create-cluster-compare.sh"
19+
- ".github/workflows/create-cluster-compare.yml"
20+
workflow_dispatch:
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
permissions:
27+
contents: read
28+
actions: read
29+
30+
env:
31+
CHARON_VERSION: v1.7.1
32+
CHARON_URL: https://github.com/ObolNetwork/charon/releases/download/v1.7.1/charon-v1.7.1-linux-amd64.tar.gz
33+
34+
jobs:
35+
create-cluster-compare:
36+
name: create cluster Charon parity
37+
runs-on: ubuntu-24.04
38+
timeout-minutes: 20
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v6
43+
44+
- name: Cache charon binary
45+
id: cache-charon
46+
uses: actions/cache@v4
47+
with:
48+
path: bin/charon
49+
key: charon-${{ env.CHARON_VERSION }}-linux-amd64
50+
51+
- name: Install charon
52+
if: steps.cache-charon.outputs.cache-hit != 'true'
53+
run: ./scripts/dkg-runner/ci/install-charon.sh bin
54+
55+
- name: Verify charon
56+
run: ./bin/charon version
57+
58+
- name: Cache cargo registry and target
59+
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
60+
61+
- name: Update apt package list
62+
run: sudo apt-get update
63+
64+
- name: Install protobuf
65+
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0
66+
with:
67+
packages: protobuf-compiler=3.21.12*
68+
version: 3.21.12
69+
70+
- name: Install oas3-gen
71+
run: cargo install oas3-gen@0.24.0
72+
73+
- name: Build pluto
74+
run: cargo build -p pluto-cli
75+
76+
- name: Run create cluster comparison
77+
env:
78+
CHARON_BIN: ${{ github.workspace }}/bin/charon
79+
PLUTO_BIN: ${{ github.workspace }}/target/debug/pluto
80+
WORK_DIR: ${{ github.workspace }}/create-cluster-compare
81+
run: ./scripts/create-cluster-compare.sh
82+
83+
- name: Upload work dir on failure
84+
if: failure()
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: create-cluster-compare-${{ github.run_id }}
88+
path: create-cluster-compare
89+
if-no-files-found: warn
90+
retention-days: 7

0 commit comments

Comments
 (0)