Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: validate anchor idl #218

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
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
81 changes: 0 additions & 81 deletions .github/workflows/dapp.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/pr_validate_anchor_idl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Validate anchor IDL

on:
pull_request:
branches: ["main"]
paths-ignore:
- "api/**" # Skip workflow when changes are made to the api/ directory

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate anchor IDL
shell: bash
run: |
if [ $(cat anchor/target/idl/glam.json | jq -r .address) == "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP" ]; then
echo "Anchor IDL program address is correct."
else
echo "Anchor IDL program address is incorrect."
echo "Program address in the main branch IDL should be GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP (mainnet deploy)."
echo "Make sure you run \"anchor build\" or \"pnpm run anchor-build\" before pushing changes to your PR."
exit 1
fi