Skip to content

Commit

Permalink
Merge branch 'development' into update_bug_bounty
Browse files Browse the repository at this point in the history
  • Loading branch information
CjS77 authored Jan 10, 2024
2 parents 681b946 + c337c5e commit 7b86efc
Show file tree
Hide file tree
Showing 224 changed files with 5,601 additions and 3,363 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/base_node_binaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cross": false,
"target_cpu": "x86-64",
"target_bins": "--bin minotari_node --bin minotari_console_wallet --bin minotari_merge_mining_proxy --bin minotari_miner",
"features": "safe"
"features": "default, safe"
},
{
"name": "linux-arm64",
Expand All @@ -28,7 +28,7 @@
"cross": false,
"target_cpu": "x86-64",
"target_bins": "--bin minotari_node --bin minotari_console_wallet --bin minotari_merge_mining_proxy --bin minotari_miner",
"features": "libtor, safe"
"features": "default, safe"
},
{
"name": "macos-arm64",
Expand All @@ -38,7 +38,7 @@
"cross": false,
"target_cpu": "generic",
"target_bins": "--bin minotari_node --bin minotari_console_wallet --bin minotari_merge_mining_proxy --bin minotari_miner",
"features": "libtor, safe",
"features": "default, safe",
"build_enabled": true
},
{
Expand Down
181 changes: 89 additions & 92 deletions .github/workflows/base_node_binaries.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .github/workflows/build_dockers_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name: Build docker images - workflow_call/on-demand
default: x86-64
features:
type: string
default: safe
default: 'safe,grpc'
version:
type: string
description: 'build tag/version'
Expand Down Expand Up @@ -183,9 +183,10 @@ jobs:
with:
images: |
#name/${{ matrix.builds.image_name }}
#ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository_owner }}/${{ matrix.builds.image_name }}
tags: |
type=raw,value=latest-${{ env.TARI_NETWORK }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=ref,event=tag
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
Expand All @@ -197,7 +198,6 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
#username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Image Provider
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/build_libffis.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@
"target": "aarch64-linux-android",
"cross": true
},
{
"runs-on": "ubuntu-latest",
"target": "x86_64-unknown-linux-gnu",
"cross": false,
"build_enabled": true
},
{
"runs-on": "ubuntu-latest",
"target": "aarch64-unknown-linux-gnu",
"cross": false,
"build_enabled": false
},
{
"runs-on": "ubuntu-latest",
"target": "riscv64gc-unknown-linux-gnu",
"cross": false,
"build_enabled": false
},
{
"runs-on": "macos-latest",
"target": "x86_64-apple-ios",
Expand All @@ -23,5 +41,29 @@
"runs-on": "macos-latest",
"target": "aarch64-apple-ios-sim",
"cross": false
},
{
"runs-on": "macos-latest",
"target": "x86_64-apple-darwin",
"cross": false,
"build_enabled": true
},
{
"runs-on": "macos-latest",
"target": "aarch64-apple-darwin",
"cross": false,
"build_enabled": true
},
{
"runs-on": "windows-latest",
"target": "x86_64-pc-windows-msvc",
"cross": false,
"build_enabled": false
},
{
"runs-on": "windows-latest",
"target": "aarch64-pc-windows-msvc",
"cross": false,
"build_enabled": false
}
]
79 changes: 50 additions & 29 deletions .github/workflows/build_libffis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ name: Build ffi libraries

env:
CARGO_UNSTABLE_SPARSE_REGISTRY: true
CARGO: cargo
# CARGO_OPTIONS: "--verbose"
CARGO_OPTIONS: "--release"
TARI_NETWORK_CHANGELOG: 'development'
TOOLCHAIN: 'stable'
## Must be a JSon string
Expand All @@ -30,28 +33,30 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
libffiss: ${{ steps.set-matrix.outputs.libffiss }}
steps:
- uses: actions/checkout@v4
- name: Checkout source code
uses: actions/checkout@v4

- name: Set Matrix from JSon file
id: set-matrix
run: |
## build all targets images
# matrix=$( jq -s -c .[] .github/workflows/build_libffis_workflow.json )
matrix=$( jq -s -c .[] ${{ env.matrix-json-file }} )
# matrix=$( jq -s -c .[] ${{ env.matrix-json-file }} )
#
## build only single target image
# matrix_selection=$( jq -c '.[] | select( ."runs-on" == "macos-latest" )' ${{ env.matrix-json-file }} )
# matrix_selection=$( jq -c '.[] | select( ."runs-on" == "ubuntu-latest" )' ${{ env.matrix-json-file }} )
# matrix_selection=$( jq -c '.[] | select( ."runs-on" == "macos-latest" )' ${{ env.matrix-json-file }} )
#
## buid select target images - build_enabled
# matrix_selection=$( jq -c '.[] | select( ."build_enabled" != false )' ${{ env.matrix-json-file }} )
matrix_selection=$( jq -c '.[] | select( ."build_enabled" != false )' ${{ env.matrix-json-file }} )
#
## Setup json array
# matrix=$(echo ${matrix_selection} | jq -s -c)
matrix=$(echo ${matrix_selection} | jq -s -c)
#
## Setup the json build matrix
# matrix=$(echo ${matrix_selection} | jq -s -c '{"builds": .}')
#
echo $matrix
echo $matrix | jq .
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
echo "libffiss=${BUILD_LIBFFIS}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -106,11 +111,15 @@ jobs:
if [[ "${{ matrix.builds.target }}" =~ "android" ]]; then
echo "CFLAGS=-DMDB_USE_ROBUST=0" >> $GITHUB_ENV
echo "TARGET_PLATFORM=android" >> $GITHUB_ENV
else
elif [[ "${{ matrix.builds.target }}" =~ "ios" ]]; then
echo "TARGET_PLATFORM=ios" >> $GITHUB_ENV
if [[ "${{ matrix.builds.target }}" =~ "-sim" ]]; then
echo "TARGET_SIM=-sim" >> $GITHUB_ENV
fi
elif [[ "${{ matrix.builds.target }}" =~ "linux-gnu" ]]; then
echo "TARGET_PLATFORM=linux" >> $GITHUB_ENV
elif [[ "${{ matrix.builds.target }}" =~ "apple-darwin" ]]; then
echo "TARGET_PLATFORM=macos" >> $GITHUB_ENV
fi
# Strip begining
tempEnv="${{ matrix.builds.target }}"
Expand All @@ -121,35 +130,47 @@ jobs:
echo "TARGET_NAME=${tempEnv%_*}" >> $GITHUB_ENV
- name: Setup Rust toolchain
if: ${{ ! matrix.builds.cross }}
uses: dtolnay/rust-toolchain@master
with:
components: rustfmt, clippy
toolchain: ${{ env.TOOLCHAIN }}
targets: ${{ matrix.builds.target }}

# Don't use caches for binary builds when releasing. Start from a clean slate.
- name: Cache cargo files and outputs
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
if: ${{ ( ! startsWith(github.ref, 'refs/tags/v') ) && ( ! matrix.builds.cross ) }}
uses: Swatinem/rust-cache@v2

- name: Install and setup cargo cross
if: ${{ matrix.builds.cross }}
shell: bash
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
- name: Install rust target/toolchain for native/local cross-compile builds
if: ${{ ! matrix.builds.cross }}
# if: ${{ ( ! matrix.builds.cross ) && env.TARGET_PLATFORM != 'ios' }}
run: |
rustup target add ${{ matrix.builds.target }}
# rustup toolchain install stable-${{ matrix.builds.target }} --force-non-host
rustup target list
rustup toolchain list
rustup show
- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "cargo options is: ${{ env.CARGO_OPTIONS }}"
echo "cross flag: ${{ matrix.builds.cross }}"
- name: Build ${{ matrix.libffis }} libraries
shell: bash
run: |
# rustup target list
# rustup toolchain list
# rustup show
if [ "${{ matrix.builds.cross }}" == "true" ]; then
cargo install cross
cross build --lib --release --locked \
--package ${{ matrix.libffis }} \
--target=${{ matrix.builds.target }}
else
rustup target add ${{ matrix.builds.target }}
# rustup toolchain install stable-aarch64-unknown-linux-gnu --force-non-host
cargo build --lib --release --locked \
--package ${{ matrix.libffis }} \
--target=${{ matrix.builds.target }}
fi
${{ env.CARGO }} build --lib ${{ env.CARGO_OPTIONS }} \
--package ${{ matrix.libffis }} \
--target=${{ matrix.builds.target }} \
--locked
- name: Prepare ${{ matrix.libffis }} libraries
shell: bash
Expand All @@ -172,7 +193,7 @@ jobs:
ls -alhtR "${{ runner.temp }}/lib${{ matrix.libffis }}-${{ env.TARGET_PLATFORM }}-${{ env.TARGET_ARCH }}${{ env.TARGET_SIM }}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: lib${{ matrix.libffis }}-${{ env.TARGET_PLATFORM }}-${{ env.TARGET_ARCH }}${{ env.TARGET_SIM }}
path: ${{ runner.temp }}/lib${{ matrix.libffis }}-${{ env.TARGET_PLATFORM }}-${{ env.TARGET_ARCH }}${{ env.TARGET_SIM }}
Expand All @@ -194,7 +215,7 @@ jobs:
run: brew install coreutils

- name: Download iOS libffiss for ${{ matrix.libffis }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
# wildcard downloads not supported yet ( minotari_*_ffi-ios-* )
# name: ${{ matrix.libffis }}-ios
Expand Down Expand Up @@ -247,7 +268,7 @@ jobs:
ls -alhtR
- name: Upload iOS universal libffis artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: lib${{ matrix.libffis }}-ios-universal
path: libffiss/lib${{ matrix.libffis }}-ios-universal
Expand Down Expand Up @@ -299,7 +320,7 @@ jobs:
ls -alhtR
- name: Upload iOS xcframework libffis artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: lib${{ matrix.libffis }}-ios-xcframework
path: libffiss/lib${{ matrix.libffis }}-ios-xcframework
Expand All @@ -311,7 +332,7 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download all ffi libraries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: libffiss

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ jobs:
run: rustup show
- name: cargo check
run: cargo check --release --all-targets --workspace --exclude tari_integration_tests --locked
- name: cargo check ffi separately
- name: cargo check wallet ffi separately
run: cargo check --release --package minotari_wallet_ffi --locked
- name: cargo check chat ffi separately
run: cargo check --release --package minotari_chat_ffi --locked
licenses:
name: file licenses
runs-on: [ubuntu-20.04]
Expand Down Expand Up @@ -201,7 +203,7 @@ jobs:
- name: cargo test
run: cargo nextest run --all-features --release -E "not package(tari_integration_tests)" --profile ci
- name: upload artifact
uses: actions/upload-artifact@v3 # upload test results as artifact
uses: actions/upload-artifact@v4 # upload test results as artifact
if: always()
with:
name: test-results
Expand All @@ -219,7 +221,7 @@ jobs:
run: echo $PR_NUM > pr_num.txt

- name: Upload the PR number
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pr_num
path: ./pr_num.txt
Expand All @@ -230,7 +232,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
6 changes: 3 additions & 3 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
--retry 2
- name: upload artifact
uses: actions/upload-artifact@v3 # upload test results as artifact
uses: actions/upload-artifact@v4 # upload test results as artifact
if: always()
with:
name: junit-cucumber
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
--retry 2
- name: upload artifact
uses: actions/upload-artifact@v3 # upload test results as artifact
uses: actions/upload-artifact@v4 # upload test results as artifact
if: always()
with:
name: junit-ffi-cucumber
Expand All @@ -203,7 +203,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
Loading

0 comments on commit 7b86efc

Please sign in to comment.