Add Linux unit test CI job, TRY_LOCK for GUI, gitignore cleanup

- Add test-linux-unit CI job; release now depends on tests passing
- Replace LOCK(cs_wallet) with TRY_LOCK in transactiontablemodel to avoid GUI freezes
- Add build artifacts to .gitignore (dist/, zips, object scripts)
- Add unit test instructions to README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 17:24:47 -07:00
parent 96b549ce95
commit 4405d34f4b
4 changed files with 47 additions and 3 deletions
+24 -1
View File
@@ -12,6 +12,29 @@ env:
VERSION: "5.3.6"
jobs:
test-linux-unit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libboost-all-dev \
libssl-dev libdb++-dev libleveldb-dev libevent-dev libminiupnpc-dev
- name: Build LevelDB
run: |
cd src/leveldb
chmod +x build_detect_platform
make clean || true
make OPT="-O2" libleveldb.a libmemenv.a
- name: Run unit tests
run: |
cd src
make -f makefile.unix test -j$(nproc)
build-windows-qt:
runs-on: windows-latest
defaults:
@@ -259,7 +282,7 @@ jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build-windows-qt, build-windows-daemon, build-linux-qt, build-linux-daemon, build-macos]
needs: [test-linux-unit, build-windows-qt, build-windows-daemon, build-linux-qt, build-linux-daemon, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
+6
View File
@@ -5,12 +5,18 @@
*.so
*.dylib
*.a
/dist/
build/
release/
debug/
/Makefile
Makefile.Debug
Makefile.Release
.qmake.stash
object_script.triangles-qt.Debug
object_script.triangles-qt.Release
/*.zip
/*.tar.gz
# Qt
moc_*.cpp
+5
View File
@@ -55,6 +55,11 @@ make -j$(nproc) -f makefile.unix USE_UPNP=0
strip trianglesd
```
Run the unit test suite:
```bash
make -C src -f makefile.unix test
```
### Linux (AlmaLinux 9 / RHEL 9)
Install dependencies:
+12 -2
View File
@@ -192,8 +192,12 @@ public:
// simply re-use the cached status.
if(rec->statusUpdateNeeded())
{
// Never block the GUI thread while the core is holding cs_wallet.
// If the lock is busy, keep showing the cached status and refresh
// it on a later paint/update cycle.
TRY_LOCK(wallet->cs_wallet, lockWallet);
if (lockWallet)
{
LOCK(wallet->cs_wallet);
std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);
if(mi != wallet->mapWallet.end())
@@ -212,8 +216,14 @@ public:
QString describe(TransactionRecord *rec)
{
// Transaction details are generated on demand from wallet/db state.
// If the wallet is busy, return a lightweight placeholder instead of
// freezing the UI until the lock becomes available.
TRY_LOCK(wallet->cs_wallet, lockWallet);
if (!lockWallet)
return parent->tr("Transaction details are temporarily unavailable while the wallet is busy.");
{
LOCK(wallet->cs_wallet);
std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);
if(mi != wallet->mapWallet.end())
{