2021-03-10 05:45:45 +01:00
|
|
|
on:
|
2021-03-11 04:03:27 +01:00
|
|
|
workflow_dispatch:
|
2021-03-10 05:45:45 +01:00
|
|
|
jobs:
|
2021-03-10 12:31:23 +01:00
|
|
|
# Wait for up to a minute for previous run to complete, abort if not done by then
|
|
|
|
pre-ci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 1
|
|
|
|
steps:
|
|
|
|
- name: 'Block Concurrent Executions'
|
|
|
|
uses: softprops/turnstyle@v1
|
|
|
|
with:
|
|
|
|
poll-interval-seconds: 10
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-03-10 05:45:45 +01:00
|
|
|
build_and_test_cross_platform:
|
2021-03-10 12:31:23 +01:00
|
|
|
needs: pre-ci
|
2021-03-10 05:45:45 +01:00
|
|
|
# The host should always be linux
|
|
|
|
runs-on: ubuntu-16.04
|
|
|
|
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
|
|
|
|
|
|
|
|
# Run steps on a matrix of 2 arch/distro combinations
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- arch: aarch64
|
|
|
|
distro: ubuntu16.04
|
|
|
|
steps:
|
|
|
|
- name: Cancel Previous Runs
|
|
|
|
uses: styfle/cancel-workflow-action@0.8.0
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/download-dl4j-test-resources-linux
|
|
|
|
- uses: ./.github/actions/install-protobuf-linux
|
|
|
|
- uses: uraimo/run-on-arch-action@v2.0.8
|
|
|
|
name: Build and test with ${{ matrix.arch }} ${{ matrix.distro }}
|
|
|
|
id: build
|
|
|
|
with:
|
|
|
|
arch: ${{ matrix.arch }}
|
|
|
|
distro: ${{ matrix.distro }}
|
|
|
|
# Pass some environment variables to the container
|
|
|
|
env: | # YAML, but pipe character is necessary
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
M2_HOME: /opt/maven
|
|
|
|
|
|
|
|
# The shell to run commands with in the container
|
|
|
|
shell: /bin/sh
|
|
|
|
run: |
|
|
|
|
echo "Running install on architecture ${{ matrix.arch }}"
|
2021-03-10 11:44:57 +01:00
|
|
|
apt-get -yq update && apt-get install -y build-essential unzip libssl-dev curl openjdk-8-jdk-headless
|
2021-03-10 05:45:45 +01:00
|
|
|
echo "After install on architecture ${{ matrix.arch }}"
|
2021-03-10 10:16:40 +01:00
|
|
|
mkdir -p "/opt/maven"
|
|
|
|
curl -fsSL http://apache.osuosl.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -xzC "/opt/maven" --strip-components=1
|
2021-03-11 00:34:31 +01:00
|
|
|
apt-get -yq update && apt-get install -y build-essential unzip libssl-dev
|
|
|
|
curl -fsSL http://cmake.org/files/v3.19/cmake-3.19.0.tar.gz | tar xz && cd cmake-3.19.0
|
|
|
|
./configure --prefix=/opt/cmake && make -j2 && make install && cd .. && rm -r cmake-3.19.0
|
2021-03-10 05:45:45 +01:00
|
|
|
export PATH="/opt/maven/bin:$PATH"
|
|
|
|
echo "RUNNING ARCH ${{ matrix.arch }}"
|
|
|
|
case "${{ matrix.arch }}" in
|
|
|
|
armv7)
|
|
|
|
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-armhf/jre
|
|
|
|
;;
|
|
|
|
aarch64)
|
|
|
|
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-arm64/jre"
|
|
|
|
;;
|
|
|
|
ppc64le)
|
|
|
|
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-ppc64el/jre
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
mvn --version
|
|
|
|
export PATH="/opt/cmake/bin:/opt/maven/bin:/opt/protobuf/bin:$PATH"
|
|
|
|
cmake --version
|
2021-03-11 00:34:31 +01:00
|
|
|
wget https://github.com/KonduitAI/dl4j-test-resources/archive/master.zip && unzip master.zip
|
|
|
|
cd dl4j-test-resources-master
|
|
|
|
mvn clean install -DskipTests
|
|
|
|
echo "Extracted test resources"
|
2021-03-10 05:45:45 +01:00
|
|
|
echo "Running build in ${pwd}"
|
2021-03-11 00:34:31 +01:00
|
|
|
curl -fsSL https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-cpp-3.5.1.tar.gz \
|
|
|
|
| tar xz && \
|
|
|
|
cd protobuf-3.5.1 && \
|
|
|
|
./configure --prefix=/opt/protobuf && \
|
|
|
|
make -j2 && \
|
|
|
|
make install && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf protobuf-3.5.1
|
|
|
|
echo "/opt/protobuf/bin" >> $GITHUB_PATH
|
2021-03-11 23:36:28 +01:00
|
|
|
mvn -X -DskipTestResourceEnforcement=true -Possrh -pl :nd4j-tests -Djavacpp.platform=linux-${{matrix.arch}} -Dlibnd4j.chip=cpu -Pcpu --batch-mode clean test -Dtest=org.nd4j.smoketests.SmokeTest
|
2021-03-10 05:45:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|