Build zed-java-api natives #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build zed-java-api natives | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
# For the Linux builds, see https://www.stereolabs.com/docs/docker/building-arm-container-on-x86 | |
jobs: | |
build-linux-x86_64: | |
runs-on: [self-hosted, ihmc-runner-nvidia] | |
container: | |
image: stereolabs/zed:4.1-devel-cuda12.1-ubuntu20.04 | |
steps: | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install git wget curl build-essential libusb-dev -y | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Compile native library (x86_64) | |
run: | | |
bash cppbuild.bash | |
- name: Commit generated java and native libraries | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '*.java *.so' # Only commit generated java from Linux | |
author_name: ihmc-rosie | |
author_email: rosie@ihmc.us | |
message: 'Rebuild natives for Linux (x86_64)' | |
push: true | |
build-linux-l4t: | |
runs-on: [self-hosted, ihmc-runner-nvidia] | |
container: | |
image: stereolabs/zed:4.1-devel-l4t-r35.3 | |
needs: [build-linux-x86_64] | |
steps: | |
- name: Test | |
run: ls | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install git wget curl build-essential libusb-dev openjdk-17-jdk -y | |
# Cannot use for now, see https://github.com/actions/setup-node/issues/922 | |
# - uses: actions/checkout@v4 | |
- name: Checkout | |
run: | | |
mkdir -p /work && cd /work | |
git clone https://github.com/ihmcrobotics/zed-java-api | |
cd zed-java-api | |
git checkout ${{ github.ref_name }} | |
# Cannot use for now, see https://github.com/actions/setup-node/issues/922 | |
# - uses: actions/setup-java@v4 | |
# with: | |
# distribution: 'temurin' | |
# java-version: '17' | |
- name: Compile native library (arm64) | |
run: | | |
cd /work/zed-java-api | |
LINUX_CROSS_COMPILE_ARM=1 bash cppbuild.bash | |
- name: Commit generated java and native libraries | |
run: | | |
git config --global user.name 'ihmc-rosie' | |
git config --global user.email 'rosie@ihmc.us' | |
git config --global url."https://github.com/".insteadOf git@github.com: | |
cd /work/zed-java-api | |
git remote set-url origin https://${{ secrets.ROSIE_PERSONAL_ACCESS_TOKEN }}@github.com/ihmcrobotics/zed-java-api.git | |
git add *.so | |
git commit -m 'Rebuild natives for Linux (arm64)' | |
git push | |
# Cannot use for now, see https://github.com/actions/setup-node/issues/922 | |
# - name: Commit generated java and native libraries | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# add: '*.so' # Only commit generated java from Linux x86_64 | |
# author_name: ihmc-rosie | |
# author_email: rosie@ihmc.us | |
# message: 'Rebuild natives for Linux (arm64)' | |
# push: true | |
- name: Clean workspace | |
if: ${{ always() }} | |
run: rm -rf /work/* | |
build-windows: | |
runs-on: [windows-2019] | |
needs: [build-linux-l4t] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull repo | |
run: | | |
git reset --hard | |
git pull | |
- uses: Jimver/cuda-toolkit@v0.2.15 | |
id: cuda-toolkit | |
with: | |
cuda: '11.8.0' | |
method: 'network' | |
- name: Install dependencies | |
run: | | |
python -m pip install gdown | |
gdown https://drive.google.com/uc?id=1m_FVVQPPe2D7HCYL4htLuAcZRN64H1OB | |
tar -xvf ZEDSDK-Windows-4.1.3.tar.gz -C "C:\\Program Files (x86)" | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
vsversion: 2019 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Check Java/Gradle versions | |
run: | | |
java --version | |
gradle --version | |
- name: Compile native library | |
run: | | |
bash.exe cppbuild.bash | |
- name: Commit native libraries | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '*.dll' # Only commit generated java from Linux | |
author_name: ihmc-rosie | |
author_email: rosie@ihmc.us | |
message: 'Rebuild natives for Windows' | |
push: true |