Skip to content
Closed
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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#

name: CI
on:
push:
branches:
- master
Comment on lines +8 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
on:
push:
branches:
- master
on: [push]


jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc-5, gcc-6, gcc-7, gcc-8]
env:
WORKFLOW: ${{ github.workflow }}
steps:
- uses: actions/checkout@v2
Comment thread
ArturHarasimiuk marked this conversation as resolved.
with:
path: neo
- name: echo
run: |
env
- name: prepare image
env:
BUILD_OS: ubuntu-18.04
COMPILER: ${{ matrix.compiler }}
working-directory: neo/scripts/actions
run: ./run-action-docker-prepare.sh
- name: build
env:
BUILD_OS: ubuntu-18.04
COMPILER: ${{ matrix.compiler }}
run: ./neo/scripts/actions/run-action-build.sh
- name: prepare artifacts
if: matrix.compiler == 'gcc-7'
run: |
mkdir artifacts
mv build/*.deb artifacts/
- name: upload artifacts
if: matrix.compiler == 'gcc-7'
uses: actions/upload-artifact@v1
with:
name: package
path: artifacts
46 changes: 46 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,49 @@ jobs:
uses: ./neo/.github/actions/neo-lint
with:
path: neo

build:
needs:
- lint
runs-on: ubuntu-latest
strategy:
matrix:
compiler:
- [gcc-7, g++-7]
- [gcc-8, g++-8]
- [gcc-9, g++-9]
- [gcc-10, g++-10]
fail-fast: false
env:
WORKFLOW: ${{ github.workflow }}
steps:
- uses: actions/checkout@v2
Comment thread
ArturHarasimiuk marked this conversation as resolved.
with:
path: neo
- name: prepare image
env:
BUILD_OS: ubuntu-20.04
working-directory: neo/scripts/actions
run: ./run-action-docker-prepare.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What about using steps.with, or steps.with.args? (docs) - it will clearly indicate which env variables are actually used and should be treated as arguments for the particular step

- name: build
env:
CC: ${{ matrix.compiler[0] }}
CXX: ${{ matrix.compiler[1] }}
BUILD_OS: ubuntu-20.04
run: ./neo/scripts/actions/run-action-build.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess this should launch a different script, right?

Would it be better to just express it via separate job in the CI workflow?

- name: prepare artifacts
if: matrix.compiler == 'gcc-7'
run: |
mkdir artifacts
mv build/*.deb artifacts/
- name: upload tests
uses: actions/upload-artifact@v1
with:
name: tests
path: build/bin
- name: upload artifacts
if: matrix.compiler == 'gcc-7'
uses: actions/upload-artifact@v1
with:
name: package
path: artifacts
19 changes: 19 additions & 0 deletions scripts/actions/docker/Dockerfile-ubuntu-20.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM docker.io/ubuntu:20.04
MAINTAINER Jacek Danecki <jacek.danecki@intel.com>

RUN apt-get -y update ; apt-get install -y --allow-unauthenticated --no-install-recommends gpg software-properties-common
RUN add-apt-repository -y ppa:intel-opencl/intel-opencl
RUN apt-get -y update ; apt-get install -y --allow-unauthenticated \
cmake \
g++-7 \
g++-8 \
g++-9 \
g++-10 \
git \
pkg-config \
ninja-build \
libigc-dev \
libigdgmm-dev \
file

CMD ["/bin/bash"]
24 changes: 24 additions & 0 deletions scripts/actions/run-action-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -x
#
# Copyright (C) 2020 Intel Corporation
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
# Copyright (C) 2020 Intel Corporation
# Copyright (C) 2021 Intel Corporation

#
# SPDX-License-Identifier: MIT
#

IMAGE=neo-${BUILD_OS}:ci
export WORKFLOW="${WORKFLOW:-VERIFY}"
export BUILD_TYPE="${BUILD_TYPE:-Release}"

echo "Using ${IMAGE}"
echo "Build type: ${BUILD_TYPE}"
echo "Workflow: ${WORKFLOW}"

rm -rf build
mkdir build

skip_unit_tests="FALSE"
if [ "${WORKFLOW^^}" = "CI" ]; then
skip_unit_tests="TRUE"
fi
docker run --rm -u `id -u`:`id -g` -v `pwd`:/src -w /src/build -e CC=${CC} -e CXX=${CXX} -t ${IMAGE} cmake -GNinja ../neo -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSKIP_UNIT_TESTS=${skip_unit_tests} -DDO_NOT_RUN_AUB_TESTS=TRUE -DDONT_CARE_OF_VIRTUALS=TRUE
docker run --rm -u `id -u`:`id -g` -v `pwd`:/src -w /src/build -t ${IMAGE} ninja package
21 changes: 21 additions & 0 deletions scripts/actions/run-action-docker-prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#
# Copyright (C) 2020 Intel Corporation
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
# Copyright (C) 2020 Intel Corporation
# Copyright (C) 2021 Intel Corporation

#
# SPDX-License-Identifier: MIT
#

DOCKERFILE=Dockerfile-${BUILD_OS}
IMAGE=neo-${BUILD_OS}:ci

if [ -n "$GEN" ]
then
DOCKERFILE=${DOCKERFILE}-${GEN}
IMAGE=neo-${BUILD_OS}-${GEN}:ci
fi

echo Using ${DOCKERFILE}

cd docker
docker build -f ${DOCKERFILE} -t ${IMAGE} .
docker images