Skip to content

Commit f29ddce

Browse files
CI windows build and test
* Add windows CI build and tests * Update README with windows build instructions * Upload codacy windows code coverage * Update build script
1 parent a136872 commit f29ddce

File tree

6 files changed

+526
-41
lines changed

6 files changed

+526
-41
lines changed
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
name: Build Windows Packages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
msys2-mingw64:
12+
name: MSYS2 MinGW64
13+
runs-on: windows-latest
14+
15+
defaults:
16+
run:
17+
shell: msys2 {0}
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Setup Python 3.13
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.13'
29+
architecture: 'x64'
30+
31+
- name: Setup MSYS2 MINGW64
32+
uses: msys2/setup-msys2@v2
33+
with:
34+
msystem: MINGW64
35+
update: true
36+
install: >-
37+
mingw-w64-x86_64-toolchain
38+
mingw-w64-x86_64-cmake
39+
mingw-w64-x86_64-openssl
40+
mingw-w64-x86_64-zeromq
41+
mingw-w64-x86_64-libsodium
42+
mingw-w64-x86_64-hidapi
43+
mingw-w64-x86_64-unbound
44+
mingw-w64-x86_64-protobuf
45+
mingw-w64-x86_64-libusb
46+
mingw-w64-x86_64-ntldd
47+
git
48+
make
49+
gettext
50+
base-devel
51+
wget
52+
53+
- name: Install ICU v75.1.1
54+
shell: msys2 {0}
55+
run: |
56+
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
57+
pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
58+
59+
- name: Install boost v1.85.0
60+
shell: msys2 {0}
61+
run: |
62+
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst
63+
pacman -U --noconfirm mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst
64+
65+
- name: Install pybind11 v2.11.1
66+
shell: msys2 {0}
67+
run: |
68+
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
69+
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
70+
71+
- name: Build monero
72+
shell: msys2 {0}
73+
run: |
74+
cd external/monero-cpp/external/monero-project
75+
mkdir -p build/release
76+
cd build/release
77+
cmake -G "MSYS Makefiles" \
78+
-D STATIC=ON \
79+
-D ARCH="x86-64" \
80+
-D BUILD_64=ON \
81+
-D CMAKE_BUILD_TYPE=Release \
82+
-D BUILD_TAG="win-x64" \
83+
-D CMAKE_TOOLCHAIN_FILE="../../cmake/64-bit-toolchain.cmake" \
84+
-D MSYS2_FOLDER=$(cd $MINGW_PREFIX/.. && pwd -W) \
85+
../../
86+
make wallet cryptonote_protocol
87+
88+
- name: Build monero-cpp
89+
shell: msys2 {0}
90+
run: |
91+
cd external/monero-cpp
92+
mkdir -p build
93+
cd build
94+
cmake ..
95+
cmake --build .
96+
97+
- name: Build monero-python
98+
shell: msys2 {0}
99+
run: |
100+
mkdir -p build
101+
cd build
102+
export WIN_PYTHON_EXE=$(cygpath -u "$PYTHON")
103+
cmake .. -DPython3_EXECUTABLE="$WIN_PYTHON_EXE" \
104+
-DPython3_FIND_STRATEGY=LOCATION \
105+
-DPython3_FIND_REGISTRY=NEVER
106+
cmake --build .
107+
mkdir -p ../dist
108+
cp *.pyd ../dist/monero.pyd
109+
ntldd -R *.pyd | grep mingw64 | awk '{print $3}' | while read -r line; do
110+
cp "$(cygpath -u "$line")" ../dist/
111+
done
112+
113+
- name: Upload artifacts
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: monero-python-win-amd64
117+
path: dist/
118+
119+
msys2-mingw32:
120+
name: MSYS2 MinGW32
121+
runs-on: windows-latest
122+
123+
defaults:
124+
run:
125+
shell: msys2 {0}
126+
127+
steps:
128+
- name: Checkout repository
129+
uses: actions/checkout@v4
130+
with:
131+
submodules: recursive
132+
133+
- name: Setup Python 3.13
134+
uses: actions/setup-python@v5
135+
with:
136+
python-version: '3.13'
137+
architecture: 'x86'
138+
139+
- name: Setup MSYS2 MINGW32
140+
uses: msys2/setup-msys2@v2
141+
with:
142+
msystem: MINGW32
143+
update: true
144+
install: >-
145+
mingw-w64-i686-toolchain
146+
mingw-w64-i686-cmake
147+
mingw-w64-i686-openssl
148+
mingw-w64-i686-zeromq
149+
mingw-w64-i686-libsodium
150+
mingw-w64-i686-hidapi
151+
mingw-w64-i686-unbound
152+
mingw-w64-i686-protobuf
153+
mingw-w64-i686-libusb
154+
mingw-w64-i686-icu
155+
mingw-w64-i686-ntldd
156+
git
157+
make
158+
gettext
159+
base-devel
160+
wget
161+
162+
- name: Install boost v1.85.0
163+
shell: msys2 {0}
164+
run: |
165+
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-boost-1.85.0-4-any.pkg.tar.zst
166+
pacman -U --noconfirm mingw-w64-i686-boost-1.85.0-4-any.pkg.tar.zst
167+
168+
- name: Install pybind11 v2.11.1
169+
shell: msys2 {0}
170+
run: |
171+
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-pybind11-2.11.1-1-any.pkg.tar.zst
172+
pacman -U --noconfirm mingw-w64-i686-pybind11-2.11.1-1-any.pkg.tar.zst
173+
174+
- name: Build monero
175+
shell: msys2 {0}
176+
run: |
177+
cd external/monero-cpp/external/monero-project
178+
mkdir -p build/release
179+
cd build/release
180+
cmake -G "MSYS Makefiles" \
181+
-D STATIC=ON \
182+
-D ARCH="i686" \
183+
-D BUILD_64=OFF \
184+
-D CMAKE_BUILD_TYPE=Release \
185+
-D BUILD_TAG="win-x32" \
186+
-D CMAKE_TOOLCHAIN_FILE="../../cmake/32-bit-toolchain.cmake" \
187+
-D MSYS2_FOLDER=$(cd $MINGW_PREFIX/.. && pwd -W) \
188+
../../
189+
make wallet cryptonote_protocol
190+
191+
- name: Build monero-cpp
192+
shell: msys2 {0}
193+
run: |
194+
cd external/monero-cpp
195+
mkdir -p build
196+
cd build
197+
cmake ..
198+
cmake --build .
199+
200+
- name: Build monero-python
201+
shell: msys2 {0}
202+
run: |
203+
mkdir -p build
204+
cd build
205+
export WIN_PYTHON_EXE=$(cygpath -u "$PYTHON")
206+
cmake .. -DPython3_EXECUTABLE="$WIN_PYTHON_EXE" \
207+
-DPython3_FIND_STRATEGY=LOCATION \
208+
-DPython3_FIND_REGISTRY=NEVER
209+
cmake --build .
210+
mkdir -p ../dist
211+
cp *.pyd ../dist/monero.pyd
212+
ntldd -R *.pyd | grep mingw64 | awk '{print $3}' | while read -r line; do
213+
cp "$(cygpath -u "$line")" ../dist/
214+
done
215+
216+
- name: Upload artifacts
217+
uses: actions/upload-artifact@v4
218+
with:
219+
name: monero-python-win-i686
220+
path: dist/

.github/workflows/codacy.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
report-coverage:
15+
report-coverage-linux:
1616
if: github.repository == 'everoddandeven/monero-python'
1717
runs-on: ubuntu-latest
1818
steps:
@@ -24,7 +24,44 @@ jobs:
2424
- name: Download coverage report
2525
uses: actions/download-artifact@v4
2626
with:
27-
name: coverage-reports
27+
name: coverage-reports-linux
28+
github-token: ${{ secrets.API_GITHUB }}
29+
run-id: ${{ github.event.workflow_run.id }}
30+
31+
- name: Report python coverage
32+
uses: codacy/codacy-coverage-reporter-action@v1
33+
with:
34+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
35+
language: python
36+
coverage-reports: coverage.xml
37+
38+
- name: Report c coverage
39+
uses: codacy/codacy-coverage-reporter-action@v1
40+
with:
41+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
42+
language: c
43+
coverage-reports: coverage.info
44+
45+
- name: Report c++ coverage
46+
uses: codacy/codacy-coverage-reporter-action@v1
47+
with:
48+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
49+
language: cpp
50+
coverage-reports: coverage.info
51+
52+
report-coverage-windows:
53+
if: github.repository == 'everoddandeven/monero-python'
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
61+
- name: Download coverage report
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: coverage-reports-windows
2865
github-token: ${{ secrets.API_GITHUB }}
2966
run-id: ${{ github.event.workflow_run.id }}
3067

0 commit comments

Comments
 (0)