Skip to content

Commit

Permalink
ci: Refactor CI workflow to consolidate build steps and enhance caching
Browse files Browse the repository at this point in the history
  • Loading branch information
gto90 committed Dec 17, 2024
1 parent b9fa6b0 commit 9d53a9c
Showing 1 changed file with 36 additions and 46 deletions.
82 changes: 36 additions & 46 deletions .github/workflows/ci-coverage-ubuntu-full-qt-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,42 @@ on:
branches: [ develop, master ]

jobs:
dependencies:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache APT Packages
uses: actions/cache@v3
with:
path: |
/var/cache/apt
/var/lib/apt/lists
key: v1-${{ runner.os }}-apt-${{ hashFiles('**/ci-coverage-ubuntu-full-qt-tests.yml') }}
restore-keys: |
v1-${{ runner.os }}-apt-
v1-${{ runner.os }}-
- 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 }}-pip-
v1-${{ runner.os }}-
v1-${{ runner.os }}-depends-${{ hashFiles('depends/Makefile') }}-
v1-${{ runner.os }}-depends-
- name: Install Basic Build Dependencies
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config python3 \
Expand All @@ -45,50 +53,32 @@ jobs:
- name: Install Python Packages
run: |
pip3 install pypandoc
pip3 install digibyte_scrypt
- name: Install BerkleyDB
run: ./contrib/install_db4.sh `pwd` --enable-cxx
pip3 install pypandoc digibyte_scrypt
- name: Cache depends build
uses: actions/cache@v3
with:
path: |
depends/built
depends/sdk-sources
depends/x86_64-linux-gnu
key: v1-${{ runner.os }}-depends-${{ hashFiles('depends/Makefile') }}
restore-keys: |
v1-${{ runner.os }}-depends-
- 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 ..
build:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Auto Generate
run: ./autogen.sh

- name: Configure
run: CONFIG_SITE=$PWD/depends/x86_64-linux-gnu/share/config.site ./configure --with-bdb --with-sqlite --with-gui=yes

- name: Make
run: make -j3
- 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: Make Check
- 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: /src/test-suite.log
path: test-suite.log

0 comments on commit 9d53a9c

Please sign in to comment.