From 69b8dfd43b1b470249f0399725216c36cb27f122 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 | 64 +++++++++++++++++++++++++++ 1 file changed, 64 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..19306b0c5ce9 --- /dev/null +++ b/.github/workflows/linux-precommit.yml @@ -0,0 +1,64 @@ +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 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + CMAKE_BUILD_TYPE: 'Debug' + GITHUB_WORKSPACE: npu-plugin-llvm + NPU_PLUGIN_LLVM_REPO: npu-plugin-llvm/npu-plugin-llvm + NPU_PLUGIN_LLVM_PROJECT: npu-plugin-llvm/npu-plugin-llvm/llvm + NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR: npu-plugin-llvm/npu-plugin-llvm/llvm/build + NPU_PLUGIN_LLVM_PROJECT_INSTALL_DIR: npu-plugin-llvm/npu-plugin-llvm/llvm/install + steps: + - name: Clone NPU Plugin LLVM sources + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: 'true' + - name: Print system info + if: runner.os == 'Linux' + shell: bash + 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: | + ls . + ls ${GITHUB_WORKSPACE} + ls ${NPU_PLUGIN_LLVM_REPO} + cmake \ + -B ${NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR} \ + -S ${NPU_PLUGIN_LLVM_PROJECT} \ + -DLLVM_ENABLE_PROJECTS=mlir \ + -DCMAKE_INSTALL_PREFIX=${NPU_PLUGIN_LLVM_PROJECT_INSTALL_DIR} \ + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + + - name: Build + run: cmake --build ${NPU_PLUGIN_LLVM_PROJECT_BUILD_DIR} --config ${CMAKE_BUILD_TYPE}