Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

altendky-testing #235

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/actions/build-asset-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@ if [[ "$bb_version" != "$BB_VERSION" ]]; then
exit 1
fi

tar -czvf $BB_ARTIFACT_NAME bladebit
mkdir ../bin
mv $BB_ARTIFACT_NAME ../bin/
ls -la ../bin

mkdir ../data
cp bladebit ../data/
236 changes: 30 additions & 206 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,228 +5,52 @@ on:
workflow_dispatch:

jobs:
build-ubuntu-x86-64:
runs-on: ubuntu-20.04
tar:
name: tar - ${{ matrix.runs-on }} - ${{ matrix.n }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [macos-11, macos-12, macos-latest]
n: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80]
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh ubuntu x86-64
run: .github/actions/get-version.sh macos x86-64

- name: Install Prerequisites
run: sudo apt install -y libgmp-dev libnuma-dev
run: brew install cmake

- name: Build
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
run: .github/actions/build-asset-unix.sh

- name: Upload Artifact Ubuntu x86-64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error

build-centos-x86-64:
runs-on: ubuntu-20.04
container:
image: quay.io/centos/centos:stream8
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh centos x86-64

- name: Install Prerequisites
- name: tar/untar
run: |
dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
cmake gmp-devel numactl-devel make git
ls -la .
ls -la data
tar -cvzf tarred.tar --directory data bladebit
tar -xvf tarred.tar

- name: Build
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
- name: post-check
shell: python
run: |
source /opt/rh/gcc-toolset-9/enable
.github/actions/build-asset-unix.sh

- name: Upload Artifact CentOS x86-64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error

build-ubuntu-arm64:
runs-on: [ARM64, Linux]
container:
image: chianetwork/ubuntu-20.04-builder:latest
defaults:
run:
shell: bash
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh ubuntu arm64

- name: Install Prerequisites
with open("data/bladebit", "rb") as f:
contents = f.read()
pre_count = contents.count(b"\x00")
print("zero pre-count:", pre_count)

with open("bladebit", "rb") as f:
contents = f.read()
post_count = contents.count(b"\x00")
print("zero post-count:", post_count)
print("ratio:", post_count / pre_count)

- name: diff
run: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y build-essential git libgmp-dev libnuma-dev

- name: Build
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
run: .github/actions/build-asset-unix.sh

- name: Upload Artifact Ubuntu ARM64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error

build-centos-arm64:
runs-on: [ARM64, Linux]
container:
image: quay.io/centos/centos:stream8
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh centos arm64

- name: Install Prerequisites
run: |
dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
cmake gmp-devel numactl-devel make git

- name: Build
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
run: |
source /opt/rh/gcc-toolset-9/enable
.github/actions/build-asset-unix.sh

- name: Upload Artifact CentOS ARM64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error

build-windows-x86-64:
runs-on: windows-2019
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
shell: bash
id: version_number
run: .github/actions/get-version.sh windows x86-64

- name: Build
shell: bash
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
run: |

mkdir build && cd build
cmake ..
bash -e -o pipefail ../embed-version.sh
cat ../src/Version.h
cmake --build . --target bladebit --config Release

# Ensure bladebit version matches expected version
bb_version="$(./Release/bladebit.exe --version | xargs)"

if [[ "$bb_version" != "$BB_VERSION" ]]; then
>&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'."
exit 1
fi

mkdir ../bin
cd Release
7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe
ls -la ../../bin

- name: Upload Artifact Windows x86-64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error

build-macos-arm64:
runs-on: [macOS, ARM64]
steps:
- name: Cleanup Environment
uses: Chia-Network/actions/clean-workspace@main

- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: bash -e .github/actions/get-version.sh macos arm64

- name: Install Prerequisites
run: brew install cmake

- name: Build
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
run: .github/actions/build-asset-unix.sh

- name: Upload Artifact macOS arm64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error

build-macos-x86-64:
runs-on: macOS-latest
steps:
- name: Cleanup Environment
uses: Chia-Network/actions/clean-workspace@main

- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh macos x86-64

- name: Install Prerequisites
run: brew install cmake

- name: Build
env:
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
run: .github/actions/build-asset-unix.sh

- name: Upload Artifact macOS x86-64
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
if-no-files-found: error
diff data/bladebit bladebit