Skip to content

Commit

Permalink
Merge pull request #256 from DigiByte-Core/bugfix/ci-cd-consolidation
Browse files Browse the repository at this point in the history
ci: Consolidates and improves the ci workflow
  • Loading branch information
ycagel authored Dec 18, 2024
2 parents 410f322 + ec5de94 commit 2c2d8ae
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 272 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/ci-coverage-mac-full-qt-tests.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/ci-coverage-mac-no-tests-no-qt.yml

This file was deleted.

91 changes: 67 additions & 24 deletions .github/workflows/ci-coverage-ubuntu-full-qt-tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,87 @@
name: 'Build & Check: Ubuntu Full QT & Tests'

on: [push]
on:
pull_request:
branches: [ develop, master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [x86_64-linux-gnu]

steps:
- uses: actions/checkout@v2

- name: Get Dependencies
run: sudo apt update && sudo apt-get install build-essential libtool libssl-dev autotools-dev automake pkg-config bsdmainutils python3 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 software-properties-common pandoc

- name: Install pypandoc
run: pip3 install pypandoc

- name: Install scrypt for Python3
run: pip3 install digibyte_scrypt
- name: Cache pip
id: 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
id: cache-db4
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
id: cache-depends
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 python3-zmq
- name: Install BerkleyDB
run: ./contrib/install_db4.sh `pwd` --enable-cxx
- name: Install Python Packages
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
pip3 install pypandoc digibyte_scrypt pyzmq
- name: Auto Generate
run: ./autogen.sh
- name: Install BerkeleyDB
if: steps.cache-db4.outputs.cache-hit != 'true'
run: |
./contrib/install_db4.sh `pwd` --enable-cxx
- name: Configure
run: export BDB_PREFIX="${PWD}/db4" && ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
- name: Build Dependencies
if: steps.cache-depends.outputs.cache-hit != 'true'
run: |
cd depends
make -j3 HOST=x86_64-linux-gnu
cd ..
- 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
run: sudo 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
44 changes: 0 additions & 44 deletions .github/workflows/ci-coverage-ubuntu-no-tests-no-qt.yml

This file was deleted.

12 changes: 1 addition & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,5 @@
"typeindex": "cpp",
"ios": "cpp"
},
"cmake.ignoreCMakeListsMissing": true,
"boost-test-adapter-robaho.tests": [
{
"testExecutables": [
{
"glob": "**/*{_test,_test.exe}"
}
],
"debugConfig": "Test Config"
}
],
"cmake.ignoreCMakeListsMissing": true
}
28 changes: 14 additions & 14 deletions ci/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## CI Scripts
# CI Scripts

This directory contains scripts for each build step in each build stage.

### Running a Stage Locally
## Running a Stage Locally

Be aware that the tests will be built and run in-place, so please run at your own risk.
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
Expand All @@ -17,21 +17,21 @@ system in a virtual machine with a Linux operating system of your choice.
To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage
requires `docker` to be installed. To install all requirements on Ubuntu, run

```
sudo apt install docker.io bash
```
```bash
sudo apt install docker.io bash
```

To run the default test stage,

```
./ci/test_run_all.sh
```
```bash
./ci/test_run_all.sh
```

To run the test stage with a specific configuration,

```
FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
```
```bash
FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
```

### Configurations

Expand All @@ -51,9 +51,9 @@ is used as the default configuration with fallback values.
It is also possible to force a specific configuration without modifying the
file. For example,

```
MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
```
```bash
MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
```

The files starting with `0n` (`n` greater than 0) are the scripts that are run
in order.
Expand Down
Loading

0 comments on commit 2c2d8ae

Please sign in to comment.