From 53424b674c727096cbf6015467f513dbfbb4428d Mon Sep 17 00:00:00 2001 From: Maksim Doronin Date: Thu, 14 Nov 2024 12:07:03 +0000 Subject: [PATCH] Linux precommit --- .github/workflows/linux-precommit.yml | 96 +++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/linux-precommit.yml diff --git a/.github/workflows/linux-precommit.yml b/.github/workflows/linux-precommit.yml new file mode 100644 index 000000000000..649f8f570921 --- /dev/null +++ b/.github/workflows/linux-precommit.yml @@ -0,0 +1,96 @@ +name: "Linux precommit" + +permissions: + contents: read + +on: + push: + pull_request: + workflow_dispatch: + branches: [ "npu/release/18.x" ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + + +jobs: + Build: + name: Build and Test + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + CMAKE_BUILD_TYPE: 'Release' + LLVM_ENABLE_ASSERTIONS: 'ON' + NPU_PLUGIN_LLVM_PROJECT: llvm + NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR: llvm/build + NPU_PLUGIN_LLVM_PROJECT_INSTALL_DIR: llvm/install + steps: + - name: Clone NPU Plugin LLVM sources + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: 'true' + - name: Print system info + run: | + # Install pre-requisites for Fedora + if [[ -e /etc/fedora-release ]]; then + yum update -y -q && yum install -y -q procps + fi + + echo "System: ${{ runner.os }}" + echo "System Architecture: ${{ runner.arch }}" + echo "CPU Info: "; lscpu + echo "RAM Info: "; free -h --si + echo "MEMORY Info: "; df -h + + - name: Configure CMake + run: | + cmake \ + -B ${NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR} \ + -S ${NPU_PLUGIN_LLVM_PROJECT} \ + -DCMAKE_INSTALL_PREFIX=${NPU_PLUGIN_LLVM_PROJECT_INSTALL_DIR} \ + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ + -DLLVM_ENABLE_WARNINGS=OFF \ + -DLLVM_ENABLE_BINDINGS=OFF \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_EH=ON \ + -DLLVM_ENABLE_BACKTRACES=OFF \ + -DLLVM_ENABLE_CRASH_OVERRIDES=OFF \ + -DLLVM_ENABLE_PROJECTS="mlir" \ + -DLLVM_ENABLE_ASSERTIONS=${LLVM_ENABLE_ASSERTIONS} \ + -DLLVM_INCLUDE_TESTS=ON \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_TARGETS_TO_BUILD="host" \ + -DCROSS_TOOLCHAIN_FLAGS_="" \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE="" \ + -DLLVM_ENABLE_TERMINFO=OFF \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_BUILD_TOOLS=OFF \ + -DLLVM_BUILD_UTILS=ON \ + -DLLVM_INSTALL_UTILS=ON \ + + - name: Build + run: | + cmake \ + --build ${NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR} \ + --config ${CMAKE_BUILD_TYPE} \ + --parallel $(nproc) + + - name: Test LLVM + run: | + cmake \ + --build ${NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR} \ + --config ${CMAKE_BUILD_TYPE} \ + --parallel $(nproc) + --target check-llvm + + - name: Test MLIR + run: | + cmake \ + --build ${NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR} \ + --config ${CMAKE_BUILD_TYPE} \ + --parallel $(nproc) + --target check-mlir