Skip to content

Commit b78454f

Browse files
committed
ci: add a re-run manual workflow
1 parent 5c08f93 commit b78454f

File tree

3 files changed

+93
-90
lines changed

3 files changed

+93
-90
lines changed

.github/workflows/re-run.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: merge check
2+
3+
on:
4+
workflow_dispatch: # Must be run manually
5+
inputs:
6+
pr_number:
7+
description: 'Pull request number to test'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
check:
13+
name: Check mergeability
14+
runs-on: ubuntu-latest
15+
env:
16+
CCACHE_DIR: /home/runner/.ccache
17+
18+
steps:
19+
- name: Checkout PR merge commit
20+
uses: actions/checkout@v5
21+
with:
22+
ref: refs/pull/${{ inputs.pr_number }}/merge
23+
fetch-depth: 1
24+
25+
- name: Create ccache dir
26+
run: |
27+
mkdir -p ${{ env.CCACHE_DIR }}
28+
29+
- name: Restore ccache
30+
uses: actions/cache@v3
31+
with:
32+
path: ${{ env.CCACHE_DIR }}
33+
key: ccache-${{ runner.os }}-${{ github.sha }}
34+
restore-keys: |
35+
ccache-${{ runner.os }}-
36+
37+
- uses: cachix/install-nix-action@v31
38+
with:
39+
nix_path: nixpkgs=channel:nixos-25.05
40+
41+
- name: Set Up Cachix
42+
uses: cachix/cachix-action@v15
43+
with:
44+
name: bitcoin-core
45+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
46+
47+
- name: Build bitcoind with ccache
48+
run: |
49+
nix develop ci/ --command bash -c "
50+
cmake -B build \
51+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
52+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
53+
-DCMAKE_BUILD_TYPE=Release \
54+
-DBUILD_DAEMON=ON \
55+
-DBUILD_BITCOIN_BIN=OFF \
56+
-DBUILD_CLI=OFF \
57+
-DBUILD_TX=OFF \
58+
-DBUILD_UTIL=OFF \
59+
-DBUILD_WALLET_TOOL=OFF \
60+
-DBUILD_TESTS=OFF \
61+
-DBUILD_BENCH=OFF \
62+
-DENABLE_WALLET=OFF \
63+
-DENABLE_EXTERNAL_SIGNER=OFF
64+
cmake --build build --target bitcoind
65+
"

ci/flake.nix

Lines changed: 28 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
description = "Bitcoin Core build derivation";
2+
description = "Bitcoin Core development environment";
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
@@ -13,76 +13,41 @@
1313
}:
1414
flake-utils.lib.eachDefaultSystem (
1515
system: let
16-
overlay = import ./overlay.nix;
1716
pkgs = import nixpkgs {
1817
inherit system;
19-
overlays = [overlay];
2018
};
21-
inherit (pkgs) lib stdenv;
22-
23-
# Shared dependencies for build and runtime
24-
commonInputs = with pkgs; [
25-
boost
26-
capnproto
27-
libevent
28-
libsystemtap
29-
linuxPackages.bcc
30-
linuxPackages.bpftrace
31-
sqlite.dev
32-
zeromq
33-
];
34-
35-
bitcoind = pkgs.ccacheStdenv.mkDerivation {
36-
pname = "bitcoin-core";
37-
version = "unstable";
38-
39-
src = ../.;
40-
41-
nativeBuildInputs =
42-
commonInputs
43-
++ (with pkgs; [
44-
ccache
45-
cmake
46-
curlMinimal
47-
ninja
48-
pkg-config
49-
]);
50-
51-
buildInputs = commonInputs;
52-
53-
env = {
54-
CMAKE_GENERATOR = "Ninja";
55-
LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.capnproto];
56-
};
19+
in {
20+
formatter = pkgs.alejandra;
5721

58-
cmakeFlags = [
59-
"-DBUILD_DAEMON=ON"
60-
"-DBUILD_BITCOIN_BIN=OFF"
61-
"-DBUILD_CLI=OFF"
62-
"-DBUILD_TX=OFF"
63-
"-DBUILD_UTIL=OFF"
64-
"-DBUILD_WALLET_TOOL=OFF"
65-
"-DBUILD_TESTS=OFF"
66-
"-DBUILD_BENCH=OFF"
67-
"-DENABLE_WALLET=OFF"
68-
"-DENABLE_EXTERNAL_SIGNER=OFF"
22+
devShells.default = pkgs.mkShell.override {
23+
stdenv = pkgs.gcc15Stdenv;
24+
} {
25+
buildInputs = with pkgs; [
26+
ccache
27+
cmake
28+
ninja
29+
pkg-config
30+
31+
boost
32+
capnproto
33+
libevent
34+
libsystemtap
35+
linuxPackages.bcc
36+
linuxPackages.bpftrace
37+
sqlite.dev
38+
zeromq
6939
];
7040

71-
stripAllList = ["bin"];
41+
shellHook = ''
42+
export CCACHE_COMPRESS=1
43+
export CCACHE_SLOPPINESS=random_seed
44+
export CCACHE_UMASK=007
45+
export CMAKE_GENERATOR=Ninja
7246
73-
meta = with lib; {
74-
description = "Bitcoin Core client";
75-
homepage = "https://bitcoincore.org/";
76-
license = licenses.mit;
77-
platforms = platforms.all;
78-
};
79-
};
80-
in {
81-
formatter = pkgs.alejandra;
82-
packages = {
83-
default = bitcoind;
84-
inherit bitcoind;
47+
echo "CCACHE_DIR: $CCACHE_DIR"
48+
'';
8549
};
8650
}
8751
);
8852
}
53+

ci/overlay.nix

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)