2022-12-29 20:29:17 +01:00
|
|
|
name: Build and test binds
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
# SHA is added to the end if on `main` to let all main workflows run
|
|
|
|
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main') && github.sha || '' }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.os }}, Python ${{ matrix.python }}, Go ${{ matrix.golang }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, ubuntu-latest]
|
2024-12-04 17:04:26 +01:00
|
|
|
golang: [ '1.22' ]
|
|
|
|
python: ['3.9', '3.10', '3.11', '3.12']
|
2022-12-29 20:29:17 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-03-16 17:34:17 +01:00
|
|
|
- uses: chia-network/actions/setup-python@main
|
2022-12-29 20:29:17 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Test Python implementation
|
|
|
|
run: |
|
|
|
|
python python-impl/impl-test.py
|
|
|
|
|
|
|
|
- name: Install Emscripten SDK
|
|
|
|
uses: mymindstorm/setup-emsdk@v11
|
|
|
|
|
|
|
|
- name: Build JavaScript bindings
|
|
|
|
run: |
|
|
|
|
emcc -v
|
|
|
|
sh emsdk_build.sh
|
|
|
|
|
|
|
|
- name: Test JavaScript bindings
|
|
|
|
run: |
|
|
|
|
sh js_test.sh
|
|
|
|
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ^${{ matrix.golang }}
|
|
|
|
|
|
|
|
- name: Prepare build system for Ubuntu
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-03-16 17:34:17 +01:00
|
|
|
sudo apt-get install -qq --yes valgrind libgmp-dev cmake
|
2022-12-29 20:29:17 +01:00
|
|
|
hash -r
|
|
|
|
cmake --version
|
|
|
|
|
|
|
|
- name: Prepare build system for macOS
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
ls -l
|
|
|
|
export MACOSX_DEPLOYMENT_TARGET=10.14
|
|
|
|
brew install gmp
|
|
|
|
|
|
|
|
- name: Build library using CMake
|
|
|
|
run: |
|
|
|
|
mkdir -p build && cd build
|
|
|
|
cmake ..
|
|
|
|
cmake --build . -- -j 6
|
|
|
|
|
|
|
|
- name: Build Go bindings
|
2024-10-09 16:25:18 +02:00
|
|
|
# TODO: macos build is broken. Whoever needs this - please fix it and remove `if` below.
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2022-12-29 20:29:17 +01:00
|
|
|
run: |
|
|
|
|
cd go-bindings
|
|
|
|
make
|