Color detect (#777) #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test with AIE tools | |
on: | |
push: | |
branches: | |
- main | |
# pull_request: | |
workflow_dispatch: | |
inputs: | |
AIE_COMMIT: | |
description: 'which aie commit to build' | |
type: string | |
required: false | |
default: '' | |
LIT_FILTER: | |
description: 'LIT_FILTER for tests (regex of paths in test/)' | |
type: string | |
required: false | |
default: 'dialect|Conversion|Targets|Integration|python' | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
# A PR number if a pull request and otherwise the commit hash. This cancels | |
# queued and in-progress runs for the same PR (presubmit) or commit | |
# (postsubmit). | |
group: ci-build-test-aie-tools-linux-${{ github.event.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
jobs: | |
build-repo: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free disk space | |
uses: descriptinc/free-disk-space@main | |
with: | |
tool-cache: true | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
swap-storage: false | |
- name: Docker prune | |
shell: bash | |
run: | | |
docker system prune -a -f | |
- uses: uraimo/[email protected] | |
name: Run commands | |
id: runcmd | |
with: | |
distro: none | |
base_image: ghcr.io/xilinx/mlir-aie/xilinx:latest | |
githubToken: ${{ github.token }} | |
dockerRunArgs: | | |
--mac-address ${{ secrets.XILINX_MAC }} | |
run: | | |
ls -l /opt/Xilinx/Vitis/2023.2/ | |
# this is the inverse of `base64 -w 1000000 Xilinx.lic` | |
# the -w ("wrap after 1000000 cols") is so that there are no spaces in the XILINX_LIC env var | |
echo -n "${{ secrets.XILINX_LIC }}" | base64 --decode > ~/.Xilinx/Xilinx.lic | |
cd / | |
git clone --recursive https://github.com/Xilinx/mlir-aie.git | |
cd /mlir-aie | |
git checkout ${{ github.head_ref }} | |
if [ x"${{ inputs.AIE_COMMIT }}" != x"" ]; then | |
git reset --hard ${{ inputs.AIE_COMMIT }} | |
fi | |
VERSION=$(utils/clone-llvm.sh --get-wheel-version) | |
pip -q download mlir==$VERSION \ | |
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro | |
unzip -q mlir-*.whl | |
pip install -r python/requirements.txt | |
# don't delete the space in the sed | |
pushd cmake/modulesXilinx && sed -i.bak 's/ VITIS_VPP//g' FindVitis.cmake && popd | |
mkdir build && cd build | |
cmake .. -G Ninja \ | |
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \ | |
-DVITIS_ROOT=/opt/Xilinx/Vitis/2023.2/ \ | |
-DVitis_VERSION_MAJOR=2023 \ | |
-DVitis_VERSION_MINOR=2 \ | |
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \ | |
-DLLVM_EXTERNAL_LIT=$(which lit) \ | |
-DAIE_INCLUDE_INTEGRATION_TESTS=ON \ | |
-DAIE_ENABLE_PYTHON_PASSES=OFF \ | |
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \ | |
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \ | |
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_INSTALL_PREFIX=install | |
ninja | |
if [ "${{ github.event_name }}" == "push" ]; then | |
LIT_FILTER="dialect|Conversion|Targets|Integration|python" | |
else | |
LIT_FILTER="${{ inputs.LIT_FILTER }}" | |
fi | |
sed -i.bak 's/-sv --timeout 600/-sv --timeout 600 -j1/g' ../test/CMakeLists.txt | |
sed -i.bak 's/-sv --timeout 300/-sv --timeout 600 -j1 --show-unsupported/g' ../reference_designs/CMakeLists.txt | |
LIT_FILTER="$LIT_FILTER" PATH=/opt/Xilinx/Vitis/2023.2/aietools/bin:$PATH ninja check-aie | |
PATH=/opt/Xilinx/Vitis/2023.2/aietools/bin:$PATH ninja check-reference-designs |