Skip to content

ci: Refactor CI workflow to consolidate build steps and enhance caching #372

ci: Refactor CI workflow to consolidate build steps and enhance caching

ci: Refactor CI workflow to consolidate build steps and enhance caching #372

name: 'Build & Check: Ubuntu Full QT & Tests'
on:
push:
pull_request:
branches: [ develop, master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pip3
key: v1-${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: v1-${{ runner.os }}-pip-
- name: Cache BerkeleyDB
uses: actions/cache@v3
with:
path: db4
key: v1-${{ runner.os }}-db4-${{ hashFiles('contrib/install_db4.sh') }}
restore-keys: v1-${{ runner.os }}-db4-
- name: Cache depends build
uses: actions/cache@v3
with:
path: |
depends/built
depends/sources
depends/sdk-sources
depends/work
depends/x86_64-linux-gnu
key: v1-${{ runner.os }}-depends-${{ hashFiles('depends/Makefile') }}-${{ github.sha }}
restore-keys: |
v1-${{ runner.os }}-depends-${{ hashFiles('depends/Makefile') }}-
v1-${{ runner.os }}-depends-
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config python3 \
libssl-dev bsdmainutils libevent-dev \
libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev \
libsqlite3-dev \
libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools \
libqrencode-dev
- name: Install Python Packages
run: |
pip3 install pypandoc digibyte_scrypt
- name: Install BerkeleyDB
run: |
if [ ! -d "db4" ]; then
./contrib/install_db4.sh `pwd` --enable-cxx
fi
- name: Build Dependencies
run: |
cd depends
make -j3 HOST=x86_64-linux-gnu
cd ..
- name: Configure and Build
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-linux-gnu/share/config.site ./configure --with-bdb --with-sqlite --with-gui=yes
make -j3
- name: Run Tests
run: make check -j3
- name: Upload Test Suite Log
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-suite-log
path: test-suite.log