New BlockPI Finality Provider #147
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: New-FP | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- 'bbn-1/finality-providers/registry/**.json' | |
- 'bbn-1/finality-providers/sigs/**.sig' | |
jobs: | |
build-eotsd: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: babylonchain/finality-provider | |
ref: v0.3.0 | |
- name: Cache eotsd | |
id: cache-eots | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./build/eotsd | |
key: key-eotsd-v030 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Compile | |
run: | | |
go mod download | |
make build | |
changed-fp-files: | |
runs-on: ubuntu-latest | |
outputs: | |
any_changed: ${{steps.changed-files-registry.outputs.any_changed}} | |
all_changed_files: ${{steps.changed-files-registry.outputs.all_changed_files}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files-registry | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: 'bbn-1/finality-providers/registry/*.json' | |
verify-new-fp: | |
needs: | |
- build-eotsd | |
- changed-fp-files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Load eotsd | |
id: cache-bin | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./build/eotsd | |
key: key-eotsd-v030 | |
- name: Debug Environment | |
run: | | |
echo "Current working directory:" | |
pwd | |
echo "List of files in current directory:" | |
ls -la | |
echo "Content of bbn-1/finality-providers/registry directory:" | |
ls -la bbn-1/finality-providers/registry | |
echo "Content of bbn-1/finality-providers/sigs directory:" | |
ls -la bbn-1/finality-providers/sigs | |
echo "EOTSD binary information:" | |
file ./build/eotsd | |
./build/eotsd --help || echo "Failed to run eotsd --help" | |
- name: Verify new FPs | |
if: needs.changed-fp-files.outputs.any_changed == 'true' | |
env: | |
ALL_CHANGED_FILES: ${{ needs.changed-fp-files.outputs.all_changed_files }} | |
run: | | |
for filePathRegistryFP in ${ALL_CHANGED_FILES}; do | |
echo "Processing file: $filePathRegistryFP" | |
nickname=$(basename "$filePathRegistryFP" .json) | |
echo "Nickname: $nickname" | |
echo "Content of JSON file:" | |
cat "$filePathRegistryFP" | |
echo "Content of signature file:" | |
cat "bbn-1/finality-providers/sigs/${nickname}.sig" | |
echo "Running verification script:" | |
EOTSD_BIN=./build/eotsd ./bbn-1/finality-providers/scripts/verify-valid-fp.sh $nickname | |
echo "Verification script exit code: $?" | |
done | |
- name: Check verify-valid-fp.sh script | |
run: | | |
echo "Content of verify-valid-fp.sh script:" | |
cat ./bbn-1/finality-providers/scripts/verify-valid-fp.sh | |
- name: Debug EOTSD version | |
run: | | |
echo "EOTSD binary location:" | |
which ./build/eotsd | |
echo "EOTSD file information:" | |
file ./build/eotsd | |
echo "EOTSD version information (if available):" | |
./build/eotsd --version || echo "No version flag available" | |
echo "EOTSD help information:" | |
./build/eotsd --help | |
echo "Go build information:" | |
go version -m ./build/eotsd || echo "Unable to get Go build info" |