Skip to content

Improve workflow

Improve workflow #288

Workflow file for this run

name: Build-dev
on:
workflow_dispatch:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
build_and_test:
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
matrix:
target: [x86_64-pc-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin]
env:
TARGET: ${{matrix.target}}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
sudo /usr/sbin/update-ccache-symlinks
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
source ~/.bashrc
- name: Install Windows dependencies
if: ${{ env.TARGET == 'x86_64-w64-mingw32' }}
run: sudo apt-get install g++-mingw-w64-x86-64-posix
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ env.TARGET }}
max-size: 2G
- name: Depends cache
id: deps-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/depends/${{ env.TARGET }}
key: ${{ env.TARGET }}-deps
- name: OSX Depends cache
id: osx-deps-cache
if: ${{ env.TARGET == 'x86_64-apple-darwin' }}
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/depends/SDKs
key: ${{ env.TARGET }}-osx-deps
- name: Install OSX dependencies
if: ${{ env.TARGET == 'x86_64-apple-darwin' && steps.osx-deps-cache.outputs.cache-hit != 'true' }}
run: |
sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso cpio
cd depends && mkdir SDKs && cd SDKs
wget http://mixakuca.ddns.net:8000/Xcode-12.2.tar.gz
tar -xzf Xcode-12.2.tar.gz
- name: Build depends
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: make -j$(nproc) -C depends HOST=${{env.TARGET}} NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1
- name: Build
env:
CONFIG_SITE: ${{ github.workspace }}/depends/${{ env.TARGET }}/share/config.site
NOWARN_CXXFLAGS: -Wno-deprecated -Wno-unused-result
run: |
./autogen.sh
./configure --enable-debug --enable-any-asset-fees
make clean
make -j$(nproc)
- name: Run tests
id: tests
if: ${{ env.TARGET == 'x86_64-pc-linux-gnu' }}
run: |
echo "Running tests"
./test/functional/test_runner.py
- name: Publish artifact - linux
if: ${{ success() || ( failure() && steps.tests.conclusion == 'failure' ) }}
uses: actions/upload-artifact@v4
with:
name: sequentia-${{ env.TARGET }}
path: |
src/elementsd
src/elements-cli*
src/elements-tx*
src/elements-util*
src/elements-wallet*