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

Test building arm bindings #53

Merged
merged 9 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
49 changes: 44 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup Node.js ${{matrix.node}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node}}

- name: Get SWIG pre-built
uses: actions/download-artifact@v2
with:
name: blst_wrap.cpp
path: prebuild/

- name: Setup Node.js ${{matrix.node}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node}}

- name: Install && Build TS + bindings
run: |
yarn config set ignore-engines true
Expand All @@ -91,6 +92,44 @@ jobs:
path: prebuild/*.node
if-no-files-found: error

build-arm:
needs: ["build-swig"]
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Get SWIG pre-built
uses: actions/download-artifact@v2
with:
name: blst_wrap.cpp
path: prebuild/

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build test arm binding
run: |
docker buildx build --platform linux/arm64 -t armbuild:latest --load --progress=plain .
docker create --name armbuild armbuild:latest
docker cp armbuild:/prebuild .

- name: Upload binding.node
uses: actions/upload-artifact@v2
if: github.repository_owner == 'chainsafe' && github.event_name != 'pull_request'
with:
name: binding.node
path: prebuild/*.node
if-no-files-found: error

benchmark:
needs: ["build-swig"]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -121,7 +160,7 @@ jobs:
node_modules/.bin/ts-node benchmark/multithreadOverhead.ts

publish:
needs: ["build-swig", "build"]
needs: ["build-swig", "build", "build-arm"]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is used to build bindings for arm64

FROM node:16

RUN apt install -y python3 g++ make
# && ln -sf python3 /usr/bin/python
COPY . .

RUN yarn bootstrap
1 change: 1 addition & 0 deletions src/scripts/buildBindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function buildBindings(binaryPath: string): Promise<void> {

await exec(nodeJsExec, [nodeGypExec, "rebuild"], {
cwd: BINDINGS_DIR,
timeout: 10 * 60 * 1000,
env: {...process.env, BLST_WRAP_CPP_PREBUILD},
});

Expand Down