Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# read by bash, which a CR at the end of a line breaks. A checkout on Windows turns the line ends into CRLF otherwise
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .github/actions/save-ccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
run: gh cache delete "$CACHE_KEY" --repo "$GITHUB_REPOSITORY" || true

- name: Save the cache
uses: actions/cache/save@v4
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
# The actions of the workflows are pinned to a commit, with the version in a comment. Dependabot updates both.
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
# let a new release settle for a week before proposing it
cooldown:
default-days: 7
commit-message:
prefix: ci

# The versions of the tools that build the site, in docs/mkdocs/requirements.in. One pull request for all of them,
# the Docs workflow builds the site with --strict and fails on an update that does not work.
- package-ecosystem: pip
directory: /docs/mkdocs
schedule:
interval: weekly
# let a new release settle for a week before proposing it
cooldown:
default-days: 7
commit-message:
prefix: docs
groups:
docs:
patterns:
- "*"
18 changes: 15 additions & 3 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- '.github/workflows/build-deb.yml'
- 'debian/**'
- 'bin/build_monero_cpp.sh'
- 'bin/hardening_flags.sh'
- 'bin/check_elf_hardening.sh'
- 'CMakeLists.txt'
workflow_dispatch:
inputs:
full:
Expand Down Expand Up @@ -54,8 +57,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive

- name: Determine package version
Expand All @@ -70,7 +74,7 @@ jobs:
docker system prune -af || true

- name: Restore ccache
uses: actions/cache/restore@v4
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ccache-deb-${{ matrix.name }}-${{ matrix.arch }}
Expand Down Expand Up @@ -101,7 +105,15 @@ jobs:
key: ccache-deb-${{ matrix.name }}-${{ matrix.arch }}

- name: Upload deb package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: python3-monero_${{ steps.version.outputs.version }}-1${{ matrix.name }}1_${{ matrix.arch }}
path: debian/artifacts/python3-monero_*.deb

# the segments and the exports of the module in the package, and the stack protector and the branch protection in its code. The
# module of the armhf package is read but not disassembled, the objdump of the arm64 runner does not read 32 bit arm.
# After the upload, so that a package that fails can be downloaded and looked at. The release needs this job to succeed
- name: Check hardening and exports
run: |
dpkg-deb -x debian/artifacts/python3-monero_*.deb deb-check
bin/check_elf_hardening.sh deb-check/usr/lib/python3/dist-packages/monero*.so
23 changes: 19 additions & 4 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches: [ main ]
paths:
- '.github/workflows/build-macos.yml'
- 'CMakeLists.txt'
- 'bin/check_macho_hardening.sh'
- 'bin/install_unbound_macos.sh'
workflow_dispatch:
workflow_call:

Expand All @@ -24,6 +27,7 @@ jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
Expand All @@ -36,13 +40,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive

- name: Install dependencies
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl@3 zmq libpgm miniupnpc expat libunwind-headers protobuf unbound ccache
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl@3 zmq libpgm miniupnpc expat libunwind-headers protobuf ccache
brew unlink boost || true
brew link boost@1.85 --force
# brew links openssl@4 into /opt/homebrew, and the -I/opt/homebrew/include of boost and zeromq comes
Expand All @@ -54,6 +59,10 @@ jobs:
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV"
pip3 install pytest pytest-cov setuptools wheel scikit-build-core --break-system-packages

# static, against openssl@3: the unbound of brew is built with OpenSSL 4
- name: Install unbound
run: bin/install_unbound_macos.sh

- name: Install pybind11 v2.13.6
run: |
pip3 install pybind11==2.13.6 pybind11-stubgen --break-system-packages
Expand All @@ -63,7 +72,7 @@ jobs:
pip3 install delocate --break-system-packages

- name: Restore ccache
uses: actions/cache/restore@v4
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ccache-${{ matrix.os }}
Expand Down Expand Up @@ -116,8 +125,14 @@ jobs:
run: |
delocate-wheel -w wheelhouse -v dist/*.whl

# the canary and the exports of the module in the wheel that is published
- name: Check hardening and exports
run: |
python3 -m zipfile -e wheelhouse/*.whl wheel-check
bin/check_macho_hardening.sh wheel-check/monero*.so

- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: monero-${{ matrix.os }}
path: wheelhouse/*.whl
35 changes: 23 additions & 12 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches: [ main ]
paths:
- '.github/workflows/build-windows.yml'
- 'CMakeLists.txt'
- 'bin/check_pe_hardening.sh'
workflow_dispatch:
workflow_call:

Expand All @@ -23,6 +25,7 @@ permissions:
jobs:
msys2-mingw64:
name: MSYS2 MinGW64
timeout-minutes: 120
runs-on: windows-latest
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
Expand All @@ -34,12 +37,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive

- name: Setup Python 3.13
uses: actions/setup-python@v5
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.13'
architecture: 'x64'
Expand All @@ -50,7 +54,7 @@ jobs:
python -m pip install scikit-build-core delvewheel

- name: Setup MSYS2 MINGW64
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
uses: msys2/setup-msys2@ec48f7c5447b3140e2b088413ae3a55687bccb6e # v2.33.0
with:
msystem: MINGW64
update: true
Expand Down Expand Up @@ -131,14 +135,14 @@ jobs:
echo "124edc26b009678a4c5e759481a364abf63ed7f2f49a53092e8bd0a47c0c0740 mingw-w64-x86_64-libusb-1.0.30-1-any.pkg.tar.zst" | sha256sum -c
pacman -U --noconfirm mingw-w64-x86_64-hidapi-0.15.0-2-any.pkg.tar.zst mingw-w64-x86_64-libusb-1.0.30-1-any.pkg.tar.zst

- name: Install boost v1.92.0
- name: Install boost v1.87.0
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.92.0-3-any.pkg.tar.zst
echo "8d5a7621778e955a52755940fe16ead78c0e57a2ff443418b43c25388df1ba2a mingw-w64-x86_64-boost-1.92.0-3-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-libs-1.92.0-3-any.pkg.tar.zst
echo "832ee9a748c387fc70e0fb90f3bd6d513db627d3c283512123aeb904f4b2dc5a mingw-w64-x86_64-boost-libs-1.92.0-3-any.pkg.tar.zst" | sha256sum -c
# boost-libs in the repo is a newer rebuild that needs the split gcc runtime
pacman -U --noconfirm mingw-w64-x86_64-boost-1.92.0-3-any.pkg.tar.zst mingw-w64-x86_64-boost-libs-1.92.0-3-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst
echo "241919a5885a9270d0e0937e71cf5e146c2a8cabecc2714f09248350181cb1b6 mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-libs-1.87.0-3-any.pkg.tar.zst
echo "5fd77df3e5983ba0d9c689f46151119e0e59b3da6850c5a0ba54068eeae7749c mingw-w64-x86_64-boost-libs-1.87.0-3-any.pkg.tar.zst" | sha256sum -c
# the version that monero-cpp builds with. The boost-libs in the repo is a newer rebuild that needs the split gcc runtime
pacman -U --noconfirm mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst mingw-w64-x86_64-boost-libs-1.87.0-3-any.pkg.tar.zst

- name: Install pybind11 v2.13.6
run: |
Expand All @@ -147,7 +151,7 @@ jobs:
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst

- name: Restore ccache
uses: actions/cache/restore@v4
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ccache-windows
Expand Down Expand Up @@ -207,8 +211,15 @@ jobs:
MINGW_BIN_WIN=$(cygpath -w "$MINGW_PREFIX/bin")
"$WIN_PYTHON_EXE" -m delvewheel repair dist/*.whl -w wheelhouse --add-path "$MINGW_BIN_WIN"

# the flags of the image (ASLR, DEP) and the exports of the module in the wheel that is published
- name: Check hardening and exports
run: |
export WIN_PYTHON_EXE=$(cygpath -u "$pythonLocation/python.exe")
"$WIN_PYTHON_EXE" -m zipfile -e wheelhouse/*.whl wheel-check
bash bin/check_pe_hardening.sh wheel-check/monero*.pyd

- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: monero-python-win-amd64
path: wheelhouse/*.whl
55 changes: 28 additions & 27 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Codacy Coverage Reporter

on:
# workflow_run is what gives this job the secret after a run of Tests on a pull request. It does not check out or run anything
# of the pull request: it downloads the coverage files, and reads them with a reporter pinned to a checksum.
on: # zizmor: ignore[dangerous-triggers]
workflow_run:
workflows:
- Tests
Expand All @@ -19,41 +21,40 @@ jobs:
# skipped every run once the repository moved to libmonero.
if: github.event.repository.fork == false && (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion != 'cancelled')
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download coverage report
id: download
uses: actions/download-artifact@v4
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: coverage-reports-linux
# without a token the action ignores run-id and looks in the current run
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Report python coverage
# The reporter is the version named here, checked against the SHA-512 written here, which is the one that Codacy publishes
# on GitHub (codacy/codacy-coverage-reporter, release 14.1.3, file codacy-coverage-reporter-linux.SHA512SUM). The action of
# Codacy and its get.sh were not pinned: they change with no commit here, and they ran with the token of the project.
# To update, set the version, download the binary and the .SHA512SUM of the release, check one against the other and write the hash
- name: Download the Codacy reporter
if: ${{ !cancelled() && steps.download.outcome == 'success' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
language: python
coverage-reports: coverage.xml
env:
REPORTER_VERSION: 14.1.3
REPORTER_SHA512: 73a6c93fc5db509fd0423d6e545759c3f61d8360ee12054e32a9277daab6add0da6c6639248f6ed6c0042366440293ebc0b6144325aef52c5d3d4b230d65eb17
run: |
curl --retry 5 --retry-delay 5 --retry-max-time 150 -fsSLo codacy-coverage-reporter "https://artifacts.codacy.com/bin/codacy-coverage-reporter/$REPORTER_VERSION/codacy-coverage-reporter-linux"
echo "$REPORTER_SHA512 codacy-coverage-reporter" | sha512sum -c -
chmod +x codacy-coverage-reporter

- name: Report c++ coverage
# only this step has the token
- name: Report python, c++ and c coverage
if: ${{ !cancelled() && steps.download.outcome == 'success' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
language: cpp
coverage-reports: coverage.info

- name: Report c coverage
if: ${{ !cancelled() && steps.download.outcome == 'success' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
language: c
coverage-reports: coverage.info
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# the commit that Tests ran on, which is the head of the pull request. A manual run has no workflow_run
COMMIT_UUID: ${{ github.event.workflow_run.head_sha || github.sha }}
run: |
./codacy-coverage-reporter report --language python --coverage-reports coverage.xml --partial --commit-uuid "$COMMIT_UUID"
./codacy-coverage-reporter report --language cpp --coverage-reports coverage.info --partial --commit-uuid "$COMMIT_UUID"
./codacy-coverage-reporter report --language c --coverage-reports coverage.info --partial --commit-uuid "$COMMIT_UUID"
./codacy-coverage-reporter final --commit-uuid "$COMMIT_UUID"
12 changes: 8 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ permissions:
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
cache: pip
Expand All @@ -60,14 +63,15 @@ jobs:

- name: Upload the site
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/mkdocs/public

deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
pages: write
id-token: write
Expand All @@ -80,4 +84,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
Loading
Loading