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

Run the DML tests from GitHub Action intead of TeamCity build #199

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
30 changes: 30 additions & 0 deletions .github/workflows/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -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 $?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some paths are hard-coded to our env. Would it make sense to start with some of the paths overrideable, like

if [ -n "$(DMLC_CC)" ] ; then export DMLC_CC=/usr/itm/... ; fi

... and probably similar for PACKAGE_REPO?
We can do the same later on request, of course.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just a quick hack to get the box moved from TC into GH ; we`re still running (or I was assuming we would still be running) on our local runners where we have simicsmp adn /usr/itm/gcc .

If we want to run outside on generic runners, we must somehow package up a docker image (or an image diff that you apply to some standard ubuntu image) that provides a decent GCC and Simics Base. I don't know how to do that, so that will have to be done and resolved later.

22 changes: 22 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -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