Skip to content

Commit 81f31ab

Browse files
committed
Nix develop: add website instructions & CI
1 parent ff90370 commit 81f31ab

File tree

4 files changed

+59
-1
lines changed

4 files changed

+59
-1
lines changed

.github/workflows/test-docs-scripts.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,45 @@ jobs:
7676
sqlite3 --version
7777
wasm-pack --version
7878
79+
test-nix-setup:
80+
name: Test Nix Setup (${{ matrix.os }})
81+
runs-on: ${{ matrix.os }}
82+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'test-doc-scripts')
83+
strategy:
84+
matrix:
85+
os: [ubuntu-22.04, ubuntu-24.04]
86+
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@v4
90+
91+
- name: Install Nix
92+
uses: DeterminateSystems/nix-installer-action@v4
93+
94+
- name: Setup Nix Cache
95+
uses: DeterminateSystems/magic-nix-cache-action@v2
96+
97+
- name: Test nix develop succeeds
98+
run: |
99+
nix develop
100+
101+
- name: Test specialised builds
102+
run: |
103+
nix develop --command ./website/docs/developers/scripts/setup/build-specialized.sh
104+
105+
- name: Test format and lint
106+
run: |
107+
nix develop --command ./website/docs/developers/scripts/setup/format-and-lint.sh
108+
109+
- name: Test run tests
110+
run: |
111+
nix develop --command ./website/docs/developers/scripts/setup/run-tests.sh
112+
113+
- name: Verify installations
114+
run: |
115+
echo "Verifying installed tools..."
116+
nix develop --command bash -c "rustc --version && cargo --version && node --version && npm --version && protoc --version && sqlite3 --version && wasm-pack --version"
117+
79118
test-docker-setup:
80119
name: Test Docker Setup Script (${{ matrix.os }})
81120
runs-on: ${{ matrix.os }}

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
support and trailing whitespace management
3131
([#1234](https://github.com/o1-labs/openmina/pull/1234))
3232

33+
34+
3335
### Changed
3436

3537
- **Build System**: Enhanced Makefile with documentation-related targets and comprehensive formatting commands ([#1234](https://github.com/o1-labs/openmina/pull/1234))
@@ -54,7 +56,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5456

5557
### Other
5658

57-
- Added a `flake.nix` for building the project on nixos/using nix ([#1241](https://github.com/o1-labs/openmina/pull/1241))
59+
- Added a `flake.nix` for building the project on nixos/using nix ([#1241](https://github.com/o1-labs/openmina/pull/1241)),
60+
together with **documentation**: instructions for developers,
61+
and test the installation commands in CI.
62+
5863

5964
## [0.16.0] - 2025-04-04
6065

website/docs/developers/getting-started.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import CloneAndBuildSh from "!!raw-loader!./scripts/setup/clone-and-build.sh";
1414
import BuildSpecializedSh from "!!raw-loader!./scripts/setup/build-specialized.sh";
1515
import RunTestsSh from "!!raw-loader!./scripts/setup/run-tests.sh";
1616
import FormatAndLintSh from "!!raw-loader!./scripts/setup/format-and-lint.sh";
17+
import NixDevelop from "!!raw-loader!./scripts/setup/nix-develop.sh";
1718

1819
Welcome to OpenMina development! This guide will help you set up your
1920
development environment and build OpenMina from source.
@@ -54,6 +55,13 @@ OpenMina requires both stable and nightly Rust toolchains:
5455

5556
<CodeBlock language="bash">{InstallWasmToolsSh}</CodeBlock>
5657

58+
#### 5. Using Nix to install dependencies automatically
59+
60+
If you're on NixOS or using nix, you can use nix flake provided in the repo to
61+
install the dependencies automatically and enter the shell:
62+
63+
<CodeBlock language="bash">{NixDevelop}</CodeBlock>
64+
5765
## Clone and Build OpenMina
5866

5967
### 1. Clone the Repository and Build
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This assumes the repository is cloned, and `flake.nix` is present
2+
# Enter nix flake environment
3+
echo "Entering nix develop flake..."
4+
nix develop
5+
6+
# Build your project afterwards using `make` as usual

0 commit comments

Comments
 (0)