diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000000..8d798cd948a90 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + compiler: [gcc-5, gcc-6, gcc-7, gcc-8] + env: + WORKFLOW: CI + steps: + - uses: actions/checkout@v2 + 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: artifacts + if: matrix.compiler == 'gcc-7' + uses: actions/upload-artifact@v1 + with: + name: package + path: artifacts diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000000000..7c0ddfa0adb29 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,37 @@ +name: verify +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + compiler: [gcc-5, gcc-6, gcc-7, gcc-8] + env: + WORKFLOW: VERIFY + steps: + - uses: actions/checkout@v2 + with: + path: neo + - 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 diff --git a/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-5 b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-5 new file mode 100644 index 0000000000000..13404fc551735 --- /dev/null +++ b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-5 @@ -0,0 +1,12 @@ +FROM docker.io/ubuntu:18.04 +MAINTAINER Jacek Danecki + +RUN apt-get -y update ; apt-get install -y --allow-unauthenticated gpg; \ + echo "deb http://ppa.launchpad.net/ocl-dev/intel-opencl/ubuntu bionic main" >> /etc/apt/sources.list; \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3086B78CC05B8B1; \ + apt-get -y update ; apt-get install -y --allow-unauthenticated cmake g++-5 git pkg-config ninja-build libigc-dev intel-gmmlib-dev file + +ENV CC gcc-5 +ENV CXX g++-5 + +CMD ["/bin/bash"] diff --git a/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-6 b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-6 new file mode 100644 index 0000000000000..bf3c565c048bc --- /dev/null +++ b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-6 @@ -0,0 +1,12 @@ +FROM docker.io/ubuntu:18.04 +MAINTAINER Jacek Danecki + +RUN apt-get -y update ; apt-get install -y --allow-unauthenticated gpg; \ + echo "deb http://ppa.launchpad.net/ocl-dev/intel-opencl/ubuntu bionic main" >> /etc/apt/sources.list; \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3086B78CC05B8B1; \ + apt-get -y update ; apt-get install -y --allow-unauthenticated cmake g++-6 git pkg-config ninja-build libigc-dev intel-gmmlib-dev file + +ENV CC gcc-6 +ENV CXX g++-6 + +CMD ["/bin/bash"] diff --git a/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-7 b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-7 new file mode 100644 index 0000000000000..626e8e7f26488 --- /dev/null +++ b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-7 @@ -0,0 +1,12 @@ +FROM docker.io/ubuntu:18.04 +MAINTAINER Jacek Danecki + +RUN apt-get -y update ; apt-get install -y --allow-unauthenticated gpg; \ + echo "deb http://ppa.launchpad.net/ocl-dev/intel-opencl/ubuntu bionic main" >> /etc/apt/sources.list; \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3086B78CC05B8B1; \ + apt-get -y update ; apt-get install -y --allow-unauthenticated cmake g++-7 git pkg-config ninja-build libigc-dev intel-gmmlib-dev file + +ENV CC gcc-7 +ENV CXX g++-7 + +CMD ["/bin/bash"] diff --git a/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-8 b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-8 new file mode 100644 index 0000000000000..dee72baf436ed --- /dev/null +++ b/scripts/actions/docker/Dockerfile-ubuntu-18.04-gcc-8 @@ -0,0 +1,12 @@ +FROM docker.io/ubuntu:18.04 +MAINTAINER Jacek Danecki + +RUN apt-get -y update ; apt-get install -y --allow-unauthenticated gpg; \ + echo "deb http://ppa.launchpad.net/ocl-dev/intel-opencl/ubuntu bionic main" >> /etc/apt/sources.list; \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3086B78CC05B8B1; \ + apt-get -y update ; apt-get install -y --allow-unauthenticated cmake g++-8 git pkg-config ninja-build libigc-dev intel-gmmlib-dev file + +ENV CC gcc-8 +ENV CXX g++-8 + +CMD ["/bin/bash"] diff --git a/scripts/actions/run-action-build.sh b/scripts/actions/run-action-build.sh new file mode 100755 index 0000000000000..aed3efdd8fef9 --- /dev/null +++ b/scripts/actions/run-action-build.sh @@ -0,0 +1,27 @@ +#!/bin/bash -x +# +# Copyright (C) 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +IMAGE=neo-${BUILD_OS}-${COMPILER}: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" + if [ "${COMPILER}" = "gcc-5" ] || [ "${COMPILER}" == "gcc-6" ]; then + skip_unit_tests="FALSE" + fi +fi +docker run --rm -u `id -u`:`id -g` -v `pwd`:/src -w /src/build -t ${IMAGE} cmake -GNinja ../neo -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSKIP_UNIT_TESTS=${skip_unit_tests} +docker run --rm -u `id -u`:`id -g` -v `pwd`:/src -w /src/build -t ${IMAGE} ninja package diff --git a/scripts/actions/run-action-docker-prepare.sh b/scripts/actions/run-action-docker-prepare.sh new file mode 100755 index 0000000000000..3fd6245ba9510 --- /dev/null +++ b/scripts/actions/run-action-docker-prepare.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Copyright (C) 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +DOCKERFILE=Dockerfile-${BUILD_OS}-${COMPILER} +IMAGE=neo-${BUILD_OS}-${COMPILER}:ci + +if [ -n "$GEN" ] +then + DOCKERFILE=${DOCKERFILE}-${GEN} + IMAGE=neo-${BUILD_OS}-${COMPILER}-${GEN}:ci +fi + +echo Using ${DOCKERFILE} + +cd docker +docker build -f ${DOCKERFILE} -t ${IMAGE} . +docker images