Skip to content
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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,23 @@ jobs:
- name: Release build
run: make build-release

- name: Verify build-info command
run: |
echo "Testing build-info command..."
./target/release/mina build-info

# Verify required fields are present
./target/release/mina build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"

# Verify version format (should be a short commit hash)
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
exit 1
fi

echo "Build info verification passed!"

- name: Upload binaries
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,44 @@ jobs:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
additional_tags: ${{ env.ADDITIONAL_TAGS }}

# Test Docker image build-info
test-docker-build-info:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
needs:
- push-node-image
steps:
- name: Set up environment variables
run: |
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
echo "DOCKER_TAG=develop" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${GITHUB_REF#refs/tags/}"
echo "DOCKER_TAG=${TAG}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
VERSION="${BRANCH_NAME#release/}"
echo "DOCKER_TAG=${VERSION}" >> $GITHUB_ENV
fi

- name: Test build-info command in Docker image
run: |
echo "Testing build-info for Docker image ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }}"

# Run build-info command
docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info

# Verify required fields are present
docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"

# Verify version format
VERSION=$(docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep "Version:" | awk '{print $2}')
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
exit 1
fi

echo "Docker image build-info verification passed!"
15 changes: 15 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,21 @@ files.
- Maintain proper capitalization for proper nouns and technical terms
- Apply this style consistently across all documentation files

**Docusaurus admonitions (:::note, :::caution, :::info, etc.):**

- Always wrap Docusaurus admonitions with `<!-- prettier-ignore-start -->` and
`<!-- prettier-ignore-stop -->` comments
- This prevents prettier from reformatting the admonition blocks
- Example:

```mdx
<!-- prettier-ignore-start -->

:::note Content of the note here :::

<!-- prettier-ignore-stop -->
```

### Documentation Script Testing

When modifying developer setup scripts in `website/docs/developers/scripts/`,
Expand Down
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ NETWORK ?= devnet
VERBOSITY ?= info
GIT_COMMIT := $(shell git rev-parse --short=8 HEAD)

# Documentation server port
DOCS_PORT ?= 3000

OPAM_PATH := $(shell command -v opam 2>/dev/null)

ifdef OPAM_PATH
Expand All @@ -41,6 +44,16 @@ endif

.PHONY: help
help: ## Ask for help!
@echo "Mina Rust Makefile - Common Variables:"
@echo " DOCS_PORT=<port> Set documentation server port (default: 3000)"
@echo " NETWORK=<network> Set network (default: devnet)"
@echo " VERBOSITY=<level> Set logging verbosity (default: info)"
@echo ""
@echo "Examples:"
@echo " make docs-serve DOCS_PORT=8080 # Start docs server on port 8080"
@echo " make run-node NETWORK=mainnet # Run node on mainnet"
@echo ""
@echo "Available targets:"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: build
Expand Down Expand Up @@ -470,13 +483,13 @@ docs-build: docs-integrate-rust docs-install ## Build the documentation website
.PHONY: docs-serve
docs-serve: docs-integrate-rust docs-install ## Serve the documentation website locally with Rust API docs
@echo "Starting documentation server with Rust API documentation..."
@echo "Documentation will be available at: http://localhost:3000"
@cd website && npm start
@echo "Documentation will be available at: http://localhost:$(DOCS_PORT)"
@cd website && npm start -- --port $(DOCS_PORT)

.PHONY: docs-build-serve
docs-build-serve: docs-build ## Build and serve the documentation website locally with Rust API docs
@echo "Serving built documentation with Rust API documentation at: http://localhost:3000"
@cd website && npm run serve
@echo "Serving built documentation with Rust API documentation at: http://localhost:$(DOCS_PORT)"
@cd website && npm run serve -- --port $(DOCS_PORT)

.PHONY: docs-build-only
docs-build-only: docs-install ## Build the documentation website without Rust API docs
Expand All @@ -488,8 +501,8 @@ docs-build-only: docs-install ## Build the documentation website without Rust AP
.PHONY: docs-serve-only
docs-serve-only: docs-install ## Serve the documentation website locally without Rust API docs
@echo "Starting documentation server (without Rust API docs)..."
@echo "Documentation will be available at: http://localhost:3000"
@cd website && npm start
@echo "Documentation will be available at: http://localhost:$(DOCS_PORT)"
@cd website && npm start -- --port $(DOCS_PORT)

.PHONY: docs-rust
docs-rust: ## Generate Rust API documentation
Expand Down
Loading
Loading