Skip to content

WIP: Ocean archive and Ocean API #4221

WIP: Ocean archive and Ocean API

WIP: Ocean archive and Ocean API #4221

name: Tests - JellyfishSDK
on:
workflow_dispatch:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
BUILD_VERSION: latest
TARGET: x86_64-pc-linux-gnu
MAKE_DEBUG: 0
GIT_VERSION: 1
jobs:
build:
runs-on: ubuntu-latest
container: defi/ain-builder:latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory '*'
- name: Populate environment
run: ./make.sh ci-export-vars
- name: Setup dependencies
run: ./make.sh ci-setup-deps
- name: Setup user dependencies
run: ./make.sh ci-setup-user-deps
- name: Restore cpp build cache
id: cpp-cache-restore
uses: actions/cache/restore@v3
with:
path: |
./build/depends
./build/src
~/.ccache
key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }}
- name: Rust build cache
uses: Swatinem/rust-cache@v2
id: rust-cache-restore
with:
workspaces: lib -> ../build/lib/target
save-if: ${{ github.ref == 'refs/heads/master' }}
shared-key: ${{ env.TARGET }}
- name: Build binaries
run: ./make.sh build
- name: Pack binaries
run: ./make.sh deploy && ./make.sh package
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: defi-bins
path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }}
test:
name: Test
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
instance: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
env:
GH_INSTANCE_TOTAL: 10
steps:
- uses: actions/checkout@v4
- name: Populate environment
run: ./make.sh ci-export-vars
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: defi-bins
path: ./build/
- name: Unpack binaries
run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/
- name: Build defi image
run: rm .dockerignore && ./make.sh docker-build-from-binaries
- uses: actions/checkout@v4
with:
repository: JellyfishSDK/jellyfish
ref: 'main'
path: jellyfish
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Run tests
run: |
cd jellyfish
npm ci
npm run compile
set -e; ver=${{ env.BUILD_VERSION }}
DEFICHAIN_DOCKER_IMAGE=defichain-${{ env.TARGET }}:${ver} npm run ci:test -- --testTimeout=600000
env:
GH_INSTANCE_INDEX: ${{ matrix.instance }}