diff --git a/.github/workflows/build-and-test.sh b/.github/workflows/build-and-test.sh new file mode 100755 index 000000000..b77d0b58c --- /dev/null +++ b/.github/workflows/build-and-test.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# © 2021-2023 Intel Corporation +# SPDX-License-Identifier: MPL-2.0 + +# Install Simics Base +PACKAGE_REPO=https://af02p-or.devtools.intel.com/artifactory/simics-repos/pub/simics-6/linux64/ +INSTALL_DIR=install +ispm install 1000-6.latest -y --install-dir $INSTALL_DIR --package-repo $PACKAGE_REPO +if [ $? -ne 0 ]; then + echo "*** Failed to install Simics Base, see build-log for details" + exit 1 +fi + +# Create project +DMLC_PROJ=proj +mkdir -p $DMLC_PROJ +./$INSTALL_DIR/*/bin/project-setup $DMLC_PROJ +pushd $DMLC_PROJ + +# Setup link to DMLC sources in repo +pushd modules/ +ln -s ../.. dmlc +popd + +# Local build of dmlc +CPUS=$(cat /proc/cpuinfo | grep ^processor | wc -l) +make dmlc -j $CPUS || exit $? + +# Run the tests +T126_JOBS=$CPUS DMLC_CC=/usr/itm/gcc/13.1.0/bin/gcc ./bin/test-runner --moduledirs modules/dmlc --suite modules/dmlc/test || exit $? diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml new file mode 100644 index 000000000..ac388d7c9 --- /dev/null +++ b/.github/workflows/build-and-test.yaml @@ -0,0 +1,22 @@ +name: Build and Test + +on: + workflow_dispatch: + pull_request: + branches: + - main + push: + branches: + - main + +env: + no_proxy: intel.com,.intel.com,localhost,127.0.0.1 + +jobs: + tests: + runs-on: [self-hosted, gklab, lgr] + steps: + - uses: actions/checkout@v3 + - name: Build and test + run: | + ./.github/workflows/build-and-test.sh