|
| 1 | +name: GraphQL Compatibility Tests |
| 2 | + |
| 3 | +# This workflow tests GraphQL queries against both OCaml and Rust Mina nodes |
| 4 | +# to ensure compatibility between implementations. |
| 5 | +# |
| 6 | +# To run locally using act (installed via gh CLI): |
| 7 | +# gh extension install https://github.com/nektos/gh-act |
| 8 | +# gh act --workflows .github/workflows/test-graphql-compatibility.yml |
| 9 | +# |
| 10 | +# Or if act is installed directly: |
| 11 | +# act -W .github/workflows/test-graphql-compatibility.yml |
| 12 | +# |
| 13 | +# To run a specific job: |
| 14 | +# gh act --workflows .github/workflows/test-graphql-compatibility.yml --job test-ocaml-node-graphql |
| 15 | +# |
| 16 | +# Prerequisites for local runs: |
| 17 | +# - Docker (for running OCaml node) |
| 18 | +# - curl and jq (for GraphQL queries) |
| 19 | +# - The website GraphQL scripts must be present |
| 20 | + |
| 21 | +on: |
| 22 | + push: |
| 23 | + pull_request: |
| 24 | + workflow_dispatch: |
| 25 | + schedule: |
| 26 | + # Run daily at 02:00 UTC |
| 27 | + - cron: "0 2 * * *" |
| 28 | + |
| 29 | +env: |
| 30 | + CARGO_TERM_COLOR: always |
| 31 | + RUST_BACKTRACE: full |
| 32 | + # OCaml node configuration |
| 33 | + OCAML_NODE_IMAGE: gcr.io/o1labs-192920/mina-daemon:3.3.0-alpha1-6929a7e-noble-devnet |
| 34 | + PEER_LIST_URL: https://storage.googleapis.com/o1labs-gitops-infrastructure/devnet/seed-list-devnet.txt |
| 35 | + |
| 36 | +jobs: |
| 37 | + test-ocaml-node-graphql: |
| 38 | + name: Test GraphQL Queries Against OCaml Node |
| 39 | + runs-on: ubuntu-22.04 |
| 40 | + timeout-minutes: 30 |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout repository |
| 44 | + uses: actions/checkout@v5 |
| 45 | + |
| 46 | + - name: Start OCaml node |
| 47 | + run: | |
| 48 | + echo "Starting OCaml node using Docker..." |
| 49 | + # Create a config directory |
| 50 | + mkdir -p ocaml-node-config |
| 51 | + # Use the specified Docker image |
| 52 | + echo "Pulling OCaml node Docker image..." |
| 53 | + docker pull $OCAML_NODE_IMAGE |
| 54 | + # Run the OCaml node in Docker with GraphQL port exposed |
| 55 | + docker run -d \ |
| 56 | + --name ocaml-mina-node \ |
| 57 | + -p 3085:3085 \ |
| 58 | + -v $(pwd)/ocaml-node-config:/root/.mina-config \ |
| 59 | + $OCAML_NODE_IMAGE \ |
| 60 | + daemon \ |
| 61 | + --rest-port 3085 \ |
| 62 | + --insecure-rest-server \ |
| 63 | + --file-log-level Debug \ |
| 64 | + --log-level Info \ |
| 65 | + --config-directory /root/.mina-config \ |
| 66 | + --peer-list-url $PEER_LIST_URL |
| 67 | + # Wait for the node to start and sync (may take several minutes) |
| 68 | + ./.github/scripts/test-graphql-remote/wait-for-graphql.sh "http://localhost:3085/graphql" 600 10 |
| 69 | + echo "OCAML_GRAPHQL_ENDPOINT=http://localhost:3085/graphql" >> $GITHUB_ENV |
| 70 | + - name: Install jq for JSON processing |
| 71 | + run: | |
| 72 | + sudo apt-get update && sudo apt-get install -y jq |
| 73 | + - name: Test GraphQL command scripts against OCaml node |
| 74 | + run: | |
| 75 | + echo "Testing all GraphQL command scripts against OCaml node..." |
| 76 | + GRAPHQL_ENDPOINT="$OCAML_GRAPHQL_ENDPOINT" ./.github/scripts/test-graphql-command-scripts.sh |
| 77 | +
|
| 78 | + - name: Cleanup |
| 79 | + if: always() |
| 80 | + run: | |
| 81 | + echo "Stopping Docker container..." |
| 82 | + docker stop ocaml-mina-node || true |
| 83 | + docker rm ocaml-mina-node || true |
0 commit comments