Skip to content

FiroDex-Desktop CI #181

FiroDex-Desktop CI

FiroDex-Desktop CI #181

name: FiroDex-Desktop CI
on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches:
- dev
- master
schedule:
- cron: '0 0 * * 1'
env:
DEX_API: "mm2_firo"
DEX_RPCPORT: 7653
DEX_RPC: "http://127.0.0.1:7653"
DEX_PROJECT_NAME: "firodex"
DEX_DISPLAY_NAME: "Firo Dex"
DEX_COMPANY: "Firo"
DEX_VERSION: "0.7.0"
DEX_WEBSITE: "https://firo.org/"
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/b/vcpkg_cache
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
RUNVCPKG_VCPKG_ROOT: ${{ github.workspace }}\komodo-wallet-desktop\ci_tools_atomic_dex\vcpkg-repo
VCPKG_ROOT: ${{ github.workspace }}\komodo-wallet-desktop\ci_tools_atomic_dex\vcpkg-repo
jobs:
ci-flow:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
ubuntu-release,
ubuntu-debug,
osx-release,
osx-debug,
windows-release,
windows-debug
]
include:
- name: ubuntu-release
os: ubuntu-20.04
qt: '5.15.2'
type: 'Release'
host: 'linux'
- name: ubuntu-debug
os: ubuntu-20.04
qt: '5.15.2'
type: 'Debug'
host: 'linux'
- name: osx-release
os: macos-12
qt: '5.15.2'
type: 'Release'
host: 'mac'
- name: osx-debug
os: macos-12
qt: '5.15.2'
type: 'Debug'
host: 'mac'
- name: windows-release
os: windows-latest
qt: '5.15.2'
type: 'Release'
host: 'windows'
- name: windows-debug
os: windows-latest
qt: '5.15.2'
type: 'Debug'
host: 'windows'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: 'true'
- name: setup cache variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install MSVC
if: runner.os == 'Windows'
uses: ilammy/[email protected]
- name: Build libwally (Windows)
if: runner.os == 'Windows'
run: |
cd '${{ github.workspace }}'
git clone -b v0.8.5 --recurse-submodules https://github.com/KomodoPlatform/libwally-core.git
cd '${{ github.workspace }}\libwally-core'
git submodule init
git submodule sync --recursive
git submodule update --init --recursive
$env:LIBWALLY_DIR='${{ github.workspace }}\libwally-core'
"$env:LIBWALLY_DIR\tools\msvc\gen_ecmult_static_context.bat"
copy src\ccan\ccan\str\hex\hex.c src\ccan\ccan\str\hex\hex_.c
copy src\ccan\ccan\base64\base64.c src\ccan\ccan\base64\base64_.c
cl /utf-8 /DUSE_ECMULT_STATIC_PRECOMPUTATION /DECMULT_WINDOW_SIZE=15 /DWALLY_CORE_BUILD /DHAVE_CONFIG_H /DSECP256K1_BUILD /I$env:LIBWALLY_DIR\src\wrap_js\windows_config /I$env:LIBWALLY_DIR /I$env:LIBWALLY_DIR\src /I$env:LIBWALLY_DIR\include /I$env:LIBWALLY_DIR\src\ccan /I$env:LIBWALLY_DIR\src\ccan\base64 /I$env:LIBWALLY_DIR\src\secp256k1 /Zi /LD src/aes.c src/anti_exfil.c src/base58.c src/base64.c src/bech32.c src/bip32.c src/bip38.c src/bip39.c src/blech32.c src/ecdh.c src/elements.c src/hex.c src/hmac.c src/internal.c src/mnemonic.c src/pbkdf2.c src/pullpush.c src/psbt.c src/script.c src/scrypt.c src/sign.c src/symmetric.c src/transaction.c src/wif.c src/wordlist.c src/ccan/ccan/crypto/ripemd160/ripemd160.c src/ccan/ccan/crypto/sha256/sha256.c src/ccan/ccan/crypto/sha512/sha512.c src/ccan/ccan/base64/base64_.c src\ccan\ccan\str\hex\hex_.c src/secp256k1/src/secp256k1.c src/secp256k1/src/precomputed_ecmult_gen.c src/secp256k1/src/precomputed_ecmult.c /Fewally.dll
Copy-Item "${{ github.workspace }}\libwally-core\wally.dll" -Destination "${{ github.workspace }}\wally\wally.dll" -force
- name: Install QT (macOS)
if: runner.os == 'macOS'
uses: jurplel/[email protected]
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: '${{ github.workspace }}'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
tools: 'tools_ifw'
setup-python: 'false'
cache: true
- name: Install QT (Linux)
if: runner.os == 'Linux'
uses: jurplel/[email protected]
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: '${{ github.workspace }}'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
setup-python: 'false'
cache: true
- name: Install QT (Windows)
if: runner.os == 'Windows'
uses: jurplel/[email protected]
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: 'C:\'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
tools: 'tools_ifw'
arch: 'win64_msvc2019_64'
cache: true
- name: Install nim (Linux)
if: runner.os == 'Linux'
run: |
export DEBIAN_FRONTEND=noninteractive
export SHELL=/bin/bash
echo "CHOOSENIM_CHOOSE_VERSION=1.6.10" >> $GITHUB_ENV
export CHOOSENIM_CHOOSE_VERSION=1.6.10
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
chmod +x choosenim.sh
./choosenim.sh -y
export PATH=/home/runner/.nimble/bin:$PATH
chmod +x /home/runner/.choosenim/toolchains/nim-1.6.10/bin/*
- name: Install deps (Linux)
if: runner.os == 'Linux'
run: |
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo ${{ github.sha }}
sudo ./ci_tools_atomic_dex/ci_scripts/linux_script.sh
- name: Install deps (MacOS)
if: runner.os == 'macOS'
run: |
./ci_tools_atomic_dex/ci_scripts/osx_script.sh
- name: Upload env variable for vpkg (MacOS)
if: runner.os == 'macOS'
run: |
echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV
echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV
- name: Upload env variable for vpkg (Linux)
if: runner.os == 'Linux'
run: |
echo "CXX=clang++-12" >> $GITHUB_ENV
echo "CC=clang-12" >> $GITHUB_ENV
- name: vcpkg deps (All)
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
appendedCacheKey: ${{ hashFiles('vcpkg.json') }}
vcpkgJsonGlob: 'vcpkg.json'
# - name: import code signing certificates (macos)
# if: runner.os == 'macOS' && 'firoorg/FiroDEX-Desktop' == github.repository
# uses: Apple-Actions/import-codesign-certs@v1
# with:
# keychain: ${{ github.run_id }}
# keychain-password: ${{ github.run_id }}
# p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
# p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
# - name: import installer code signing certificates (macos)
# if: runner.os == 'macOS' && 'firoorg/FiroDEX-Desktop' == github.repository
# uses: apple-actions/import-codesign-certs@v1
# with:
# keychain: ${{ github.run_id }}
# keychain-password: ${{ github.run_id }}
# create-keychain: false
# p12-file-base64: ${{ secrets.CERTIFICATES_INSTALLER_P12 }}
# p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build AtomicDEX (MacOS)
if: runner.os == 'macOS'
run: |
xcrun --sdk macosx --show-sdk-path
export SDK_PATH=$(xcrun --sdk macosx --show-sdk-path)
ls /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
echo $HOME/sdk
ls $HOME/sdk
export MAC_SIGN_IDENTITY="${{ secrets.MAC_SIGN_IDENTITY }}"
export INSTALLER_MAC_SIGN_IDENTITY="${{ secrets.INSTALLER_MAC_SIGN_IDENTITY }}"
export APPLE_ATOMICDEX_PASSWORD="${{ secrets.APPLE_ATOMICDEX_PASSWORD }}"
export APPLE_ID="${{ secrets.APPLE_ID }}"
export ASC_PUBLIC_ID="${{ secrets.ASC_PUBLIC_ID }}"
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export MACOSX_DEPLOYMENT_TARGET=10.15
export CC=clang
export CXX=clang++
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex bundle ${{ matrix.type }} --osx_sdk=$HOME/sdk/MacOSX10.15.sdk --compiler=clang++
- name: Build AtomicDEX (Linux)
if: runner.os == 'Linux'
run: |
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
#export CXXFLAGS=-stdlib=libc++
#export LDFLAGS=-stdlib=libc++
export CXX=clang++-12
export CC=clang-12
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex build ${{ matrix.type }}
./ci_tools_atomic_dex bundle ${{ matrix.type }}
- name: Build FiroDEX (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
$Env:QT_VERSION = "${{ matrix.qt }}"
$Env:CMAKE_BUILD_TYPE = "${{ matrix.type }}"
.\ci_tools_atomic_dex\ci_scripts\windows_script.ps1
- name: Upload env variable for artifacts (Linux)
if: runner.os == 'Linux'
run: |
echo "artifact_name_zstd=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).tar.zst" >> $GITHUB_ENV
echo "artifact_name_zip=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "artifact_name_appimage=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD)-x86_64.AppImage" >> $GITHUB_ENV
echo "target_name_zip=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "target_name_appimage=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD)-x86_64.AppImage" >> $GITHUB_ENV
- name: Upload bundle artifact (Linux ZSTD)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zstd }}
path: ./bundled/linux/${{ env.target_name_zstd }}
retention-days: 7
- name: Upload bundle artifact (Linux ZIP)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/linux/${{ env.target_name_zip }}
retention-days: 7
- name: Upload bundle artifact (Linux AppImage)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_appimage }}
path: ./bundled/linux/${{ env.target_name_appimage }}
retention-days: 7
- name: Upload env variable for artifacts (macOS)
if: runner.os == 'macOS'
run: |
echo "artifact_name_dmg=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).dmg" >> $GITHUB_ENV
echo "artifact_name_installer=${{ env.DEX_PROJECT_NAME }}-installer-${{ matrix.name }}-$(git rev-parse --short HEAD).7z" >> $GITHUB_ENV
- name: Upload artifacts (MacOS dmg)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_dmg }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}.dmg
retention-days: 7
- name: Upload artifacts (MacOS installer)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}_installer.7z
retention-days: 7
- name: Upload env variable for artifacts (Windows)
if: runner.os == 'Windows'
run: |
echo "on_windows"
echo "artifact_name_zip=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).zip" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "artifact_name_installer=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-installer-$(git rev-parse --short HEAD).exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload artifacts (Windows zip)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}.zip
retention-days: 7
- name: Upload artifacts (Windows installer)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}_installer.exe
retention-days: 7
- name: Running Tests (Linux)
working-directory: ci_tools_atomic_dex
continue-on-error: true
if: runner.os == 'Linux' && 'firoorg/FiroDEX-Desktop' == github.repository
run: |
export REPORT_CI_TOKEN=${{ secrets.REPORT_CI_TOKEN_SECRET }}
export ATOMICDEX_TEST_SEED=${{ secrets.ATOMICDEX_TEST_SEED }}
export ATOMICDEX_PASSWORD=${{ secrets.ATOMICDEX_PASSWORD }}
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
export CXX=clang++-12
export CC=clang-12
#echo "Running tests"
#./ci_tools_atomic_dex tests ${{ matrix.type }}
#cd build-${{ matrix.type }}/bin/AntaraAtomicDexTestsAppDir/usr/bin
#cat ${{ env.DEX_PROJECT_NAME }}-tests-result.xml
- name: Running Tests (MacOS)
working-directory: ci_tools_atomic_dex
continue-on-error: true
if: runner.os == 'macOS' && 'firoorg/FiroDEX-Desktop' == github.repository
run: |
export MAC_SIGN_IDENTITY="${{ secrets.MAC_SIGN_IDENTITY }}"
export INSTALLER_MAC_SIGN_IDENTITY="${{ secrets.INSTALLER_MAC_SIGN_IDENTITY }}"
export APPLE_ATOMICDEX_PASSWORD="${{ secrets.APPLE_ATOMICDEX_PASSWORD }}"
export APPLE_ID="${{ secrets.APPLE_ID }}"
export ASC_PUBLIC_ID="${{ secrets.ASC_PUBLIC_ID }}"
export MACOSX_DEPLOYMENT_TARGET=10.13
export REPORT_CI_TOKEN=${{ secrets.REPORT_CI_TOKEN_SECRET }}
export ATOMICDEX_TEST_SEED=${{ secrets.ATOMICDEX_TEST_SEED }}
export ATOMICDEX_PASSWORD=${{ secrets.ATOMICDEX_PASSWORD }}
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export CC=clang
export CXX=clang++
#echo "Running tests"
#nimble build -y
#./ci_tools_atomic_dex tests ${{ matrix.type }}
#cd build-${{ matrix.type }}/bin/${{ env.DEX_PROJECT_NAME }}_tests.app/Contents/MacOS
#cat ${{ env.DEX_PROJECT_NAME }}-tests-result.xml
- name: Running Tests (Windows)
shell: powershell
continue-on-error: true
if: runner.os == 'Windows' && 'firoorg/FiroDEX-Desktop' == github.repository
run: |
#echo "Running tests"
$Env:REPORT_CI_TOKEN = "${{ secrets.REPORT_CI_TOKEN_SECRET }}"
$Env:QT_INSTALL_CMAKE_PATH = "C:\Qt\${{ matrix.qt }}\msvc2019_64"
#cd b\bin
#./${{ env.DEX_PROJECT_NAME }}_tests.exe --reporters=xml --out=${{ env.DEX_PROJECT_NAME }}-tests-result.xml -s
#Invoke-WebRequest -Uri https://report.ci/upload.py -OutFile upload.py
#python upload.py --sha $(git rev-parse HEAD) -n "[Doctest Windows]" --include='${{ env.DEX_PROJECT_NAME }}-tests-result.xml' --framework=doctest --merge ".*"