Skip to content

Commit d721588

Browse files
Improve CI: build caching, self-contained packages, accurate deb deps
* Cache monero/monero-cpp builds across linux/windows/macos jobs, keyed on the submodule commit (test.yml, build-macos.yml, build-windows.yml) * Add GHA docker buildx layer cache to build-deb.yml * Guard codacy.yml against running on a failed/cancelled Tests run * Scope workflow permissions to contents: read by default * Build Windows package as a real wheel (pip wheel + delvewheel) instead of a raw dist folder * Repair macOS wheels with delocate to bundle Homebrew dylibs * Compute .deb runtime dependencies with dpkg-shlibdeps instead of a hand-maintained per-codename version list * Bump expat/unbound with checksum verification in Dockerfile.linux * Add monero-cpp coverage HTML report and summary tables to test.yml * Pin msys2/setup-msys2 to an exact commit and drop redundant shell: msys2 {0} overrides
1 parent d0ae81a commit d721588

12 files changed

Lines changed: 202 additions & 61 deletions

File tree

‎.github/workflows/build-deb.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [ main ]
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
name: ${{ matrix.distro_name }} (${{ matrix.name }} / ${{ matrix.arch }})
@@ -95,6 +98,8 @@ jobs:
9598
--build-arg THREADS=3 \
9699
-t monero-python:${{ matrix.name }}-${{ matrix.arch }} \
97100
-f Dockerfile.linux \
101+
--cache-from type=gha,scope=${{ matrix.name }}-${{ matrix.arch }} \
102+
--cache-to type=gha,mode=max,scope=${{ matrix.name }}-${{ matrix.arch }} \
98103
--load \
99104
.
100105

‎.github/workflows/build-macos.yml‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@ on:
55
branches: [ main ]
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
10-
name: ${{ matrix.os }} (arm64)
13+
name: ${{ matrix.os }}
1114
runs-on: ${{ matrix.os }}
1215

1316
strategy:
1417
fail-fast: false
1518
matrix:
16-
os: [macos-14, macos-15]
19+
os: [macos-14, macos-15, macos-15-intel]
1720

1821
steps:
1922
- name: Checkout repository
2023
uses: actions/checkout@v4
2124
with:
2225
submodules: recursive
2326

27+
- name: Determine monero submodule version
28+
run: git submodule status --recursive > .monero-submodule-version
29+
30+
- name: Cache monero/monero-cpp build
31+
id: cache-monero
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
external/monero-cpp/external/monero-project/build
36+
external/monero-cpp/build
37+
key: monero-build-macos-${{ matrix.os }}-${{ hashFiles('.monero-submodule-version') }}
38+
restore-keys: |
39+
monero-build-macos-${{ matrix.os }}-
40+
2441
- name: Install dependencies
2542
run: |
2643
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf unbound
@@ -32,7 +49,12 @@ jobs:
3249
run: |
3350
pip3 install pybind11==2.13.6 pybind11-stubgen --break-system-packages
3451
52+
- name: Install delocate
53+
run: |
54+
pip3 install delocate --break-system-packages
55+
3556
- name: Build monero
57+
if: steps.cache-monero.outputs.cache-hit != 'true'
3658
run: |
3759
cd external/monero-cpp/external/monero-project
3860
mkdir -p build/release
@@ -42,6 +64,7 @@ jobs:
4264
cd ../../../../../../
4365
4466
- name: Build monero-cpp
67+
if: steps.cache-monero.outputs.cache-hit != 'true'
4568
run: |
4669
cd external/monero-cpp
4770
mkdir -p build
@@ -56,8 +79,12 @@ jobs:
5679
mkdir -p build
5780
python3 -m pip wheel . -w dist --no-build-isolation
5881
82+
- name: Repair wheel with delocate
83+
run: |
84+
delocate-wheel -w wheelhouse -v dist/*.whl
85+
5986
- name: Upload artifacts
6087
uses: actions/upload-artifact@v4
6188
with:
6289
name: monero-${{ matrix.os }}
63-
path: dist/*.whl
90+
path: wheelhouse/*.whl

‎.github/workflows/build-windows.yml‎

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [ main ]
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
msys2-mingw64:
1013
name: MSYS2 MinGW64
@@ -20,14 +23,34 @@ jobs:
2023
with:
2124
submodules: recursive
2225

26+
- name: Determine monero submodule version
27+
shell: bash
28+
run: git submodule status --recursive > .monero-submodule-version
29+
30+
- name: Cache monero/monero-cpp build
31+
id: cache-monero
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
external/monero-cpp/external/monero-project/build
36+
external/monero-cpp/build
37+
key: monero-build-windows-${{ hashFiles('.monero-submodule-version') }}
38+
restore-keys: |
39+
monero-build-windows-
40+
2341
- name: Setup Python 3.13
2442
uses: actions/setup-python@v5
2543
with:
2644
python-version: '3.13'
2745
architecture: 'x64'
2846

47+
- name: Install Python build dependencies
48+
shell: bash
49+
run: |
50+
python -m pip install scikit-build-core delvewheel
51+
2952
- name: Setup MSYS2 MINGW64
30-
uses: msys2/setup-msys2@v2
53+
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
3154
with:
3255
msystem: MINGW64
3356
update: true
@@ -49,25 +72,25 @@ jobs:
4972
wget
5073
5174
- name: Install ICU v75.1
52-
shell: msys2 {0}
5375
run: |
5476
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst
77+
echo "bf57882d43efcdfd746463613ea982c69b64aa4ba9bed4cb24c02a81ad06c3a9 mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst" | sha256sum -c
5578
pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst
5679
5780
- name: Install boost v1.87.0
58-
shell: msys2 {0}
5981
run: |
6082
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst
83+
echo "241919a5885a9270d0e0937e71cf5e146c2a8cabecc2714f09248350181cb1b6 mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst" | sha256sum -c
6184
pacman -U --noconfirm mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst
6285
63-
- name: Install pybind11 v2.13.1
64-
shell: msys2 {0}
86+
- name: Install pybind11 v2.13.6
6587
run: |
6688
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst
89+
echo "5b56ad87bc544336b2d51edb8bb0614f46542571362daf4d7e53bf23120175a1 mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst" | sha256sum -c
6790
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst
6891
6992
- name: Build monero
70-
shell: msys2 {0}
93+
if: steps.cache-monero.outputs.cache-hit != 'true'
7194
run: |
7295
cd external/monero-cpp/external/monero-project
7396
mkdir -p build/release
@@ -84,33 +107,30 @@ jobs:
84107
make wallet cryptonote_protocol
85108
86109
- name: Build monero-cpp
87-
shell: msys2 {0}
110+
if: steps.cache-monero.outputs.cache-hit != 'true'
88111
run: |
89112
cd external/monero-cpp
90113
mkdir -p build
91114
cd build
92115
cmake ..
93116
cmake --build .
94117
95-
- name: Build monero-python
96-
shell: msys2 {0}
118+
- name: Build wheel
97119
run: |
98-
mkdir -p build
99-
cd build
100120
export WIN_PYTHON_EXE=$(cygpath -u "$PYTHON")
101-
cmake .. -DPython3_EXECUTABLE="$WIN_PYTHON_EXE" \
102-
-DPython3_FIND_STRATEGY=LOCATION \
103-
-DPython3_FIND_REGISTRY=NEVER
104-
cmake --build .
105-
mkdir -p ../dist
106-
cp *.pyd ../dist/monero.pyd
107-
cd ../dist
108-
ntldd -R *.pyd | grep mingw64 | awk '{print $3}' | while read -r line; do
109-
cp "$(cygpath -u "$line")" .
110-
done
121+
"$WIN_PYTHON_EXE" -m pip wheel . -w dist --no-build-isolation \
122+
-C cmake.define.Python3_EXECUTABLE="$WIN_PYTHON_EXE" \
123+
-C cmake.define.Python3_FIND_STRATEGY=LOCATION \
124+
-C cmake.define.Python3_FIND_REGISTRY=NEVER
125+
126+
- name: Repair wheel with delvewheel
127+
run: |
128+
export WIN_PYTHON_EXE=$(cygpath -u "$PYTHON")
129+
MINGW_BIN_WIN=$(cygpath -w "$MINGW_PREFIX/bin")
130+
"$WIN_PYTHON_EXE" -m delvewheel repair dist/*.whl -w wheelhouse --add-path "$MINGW_BIN_WIN"
111131
112132
- name: Upload artifacts
113133
uses: actions/upload-artifact@v4
114134
with:
115135
name: monero-python-win-amd64
116-
path: dist/
136+
path: wheelhouse/*.whl

‎.github/workflows/codacy.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
report-coverage-linux:
16-
if: github.repository == 'everoddandeven/monero-python'
16+
if: github.repository == 'everoddandeven/monero-python' && (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success')
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout code

0 commit comments

Comments
 (0)