Skip to content
Open
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
39 changes: 31 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
ubuntu:
name: Build, Test, and Lint on Ubuntu
name: Build and Test on Ubuntu
runs-on: ubuntu-latest

steps:
Expand All @@ -31,11 +31,6 @@ jobs:
- name: Run tests
run: make test

- name: Run linter
uses: golangci/golangci-lint-action@v9
with:
version: v2.6.1

macos:
name: Build and Test on macOS
runs-on: macos-latest
Expand All @@ -46,7 +41,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.3'
go-version: '1.23'

- name: Install Boost library
run: |
Expand Down Expand Up @@ -86,7 +81,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.3'
go-version: '1.23'

- name: Build Kernel
run: make build-kernel
Expand All @@ -96,3 +91,31 @@ jobs:

- name: Run tests
run: make test

nix:
name: Build, Test, and Lint with Nix (Ubuntu)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Setup Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Check flake
run: nix flake check --show-trace

- name: Build Kernel
run: nix develop --command make build-kernel

- name: Build
run: nix develop --command make build

- name: Run tests
run: nix develop --command make test

- name: Run linter
run: nix develop --command make lint
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ lint:
golangci-lint run ./...

deps:
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.1
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6

update-kernel:
git subtree pull --prefix=depend/bitcoin https://github.com/bitcoin/bitcoin.git master --squash
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ This command will configure Bitcoin Core's CMake build system and statically com
[macOS](./depend/bitcoin/doc/build-osx.md),
[Windows](./depend/bitcoin/doc/build-windows.md))

**Addtional note for Windows:** MinGW toolchain is required. CGo uses GCC on Windows, so static linking requires the library to be compiled with GCC/MinGW rather than MSVC for ABI compatibility.
**Additional notes:**
- **For Windows:** MinGW toolchain is required. CGo uses GCC on Windows, so static linking requires the library to be compiled with GCC/MinGW rather than MSVC for ABI compatibility.
- **For Nix users:** Run `nix develop` to automatically get all the build and runtime dependencies, then run `make build-kernel` and continue with the remaining steps in the Nix dev shell.

### Step 3: Run Tests

Expand Down
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
description = "go-bitcoinkernel";

inputs = {
nixpkgs.url = "nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
nativeDeps = with pkgs; [
cmake
go_1_23
golangci-lint
];
runtimeDeps = with pkgs; [
boost
];
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = nativeDeps;
buildInputs = runtimeDeps;
};
});
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/stringintech/go-bitcoinkernel

go 1.23.3
go 1.23
Loading