name: Linting on: workflow_dispatch: push: branches: [ "amd-staging" ] paths-ignore: - '.github/workflows/pull_*.yml' - '*.md' pull_request: branches: [ "amd-staging" ] paths-ignore: - '.github/workflows/pull_*.yml' - '*.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: # TODO(jrmadsen): replace LD_RUNPATH_FLAG, GPU_LIST, etc. with internal handling in cmake GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 ROCM_PATH: "/opt/rocm" CMAKE_PREFIX_PATH: "/opt/rocm" LD_RUNPATH_FLAG: " -Wl,--enable-new-dtags -Wl,--rpath,/opt/rocm/lib" GPU_LIST: "gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030 gfx1100 gfx1101 gfx1102" jobs: get_latest_mainline_build_number: runs-on: mi200 outputs: LATEST_BUILD_NUMBER: ${{ steps.get_build_number.outputs.LATEST_BUILD_NUMBER }} steps: - id: get_build_number run: echo "LATEST_BUILD_NUMBER=$(wget -qO- 'http://rocm-ci.amd.com/job/compute-rocm-dkms-no-npi-hipclang/lastSuccessfulBuild/buildNumber')" >> $GITHUB_OUTPUT linting: strategy: fail-fast: false matrix: include: - build-type: 'Debug' linter: 'clang-tidy' runner: 'mi100' os: 'ubuntu-22.04' - build-type: 'Release' linter: 'clang-tidy' runner: 'vega20' os: 'ubuntu-22.04' runs-on: ${{ matrix.runner }} needs: get_latest_mainline_build_number container: image: compute-artifactory.amd.com:5000/rocm-plus-docker/compute-rocm-dkms-no-npi-hipclang:${{ needs.get_latest_mainline_build_number.outputs.LATEST_BUILD_NUMBER }}-${{ matrix.os }}-stg1 options: --ipc=host --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --cap-add CAP_SYS_PTRACE --cap-add CAP_SYS_ADMIN --security-opt seccomp=unconfined steps: - uses: actions/checkout@v3 - name: List Files shell: bash run: | which-realpath() { echo "$1 resolves to $(realpath $(which $1))"; } for i in python python3 git cmake ctest; do which-realpath $i; done ls -la - name: Update container run: | apt-get update apt-get install -y clang-tidy-11 g++-12 update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-11 10 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 - name: Install Python requirements shell: bash run: | python3 -m pip install -r requirements.txt - name: Configure, Build, and Test timeout-minutes: 30 shell: bash run: python3 ./script/run-ci.py -B build --name ${{ github.repository }}-${{ github.ref_name }}-${{ matrix.runner }}-${{ matrix.linter }}-${{ matrix.build-type }} --build-jobs 12 --site ${{ matrix.runner }} --gpu-targets ${{ env.GPU_LIST }} --linter ${{ matrix.linter }} -- -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="${{ env.ROCM_PATH }}" -DCMAKE_MODULE_PATH="${{ env.ROCM_PATH }}/hip/cmake;${{ env.ROCM_PATH }}/lib/cmake" -DCMAKE_SHARED_LINKER_FLAGS="${{ env.LD_RUNPATH_FLAG }}" -DCMAKE_INSTALL_RPATH=${{ env.ROCM_PATH }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DPython3_EXECUTABLE=$(which python3) -- -VV