Skip to content

Building inside docker container #9

Building inside docker container

Building inside docker container #9

Workflow file for this run

name: Build
on:
workflow_dispatch:
workflow_call:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
build: [
{runs-on: ubuntu-latest, build_type: Release, enable_runtime: OFF},
{runs-on: self-hosted, build_type: Release, enable_runtime: OFF},
# {build_type: Release, enable_runtime: ON},
]
runs-on: ${{ matrix.build.runs-on }}
container:
image: ghcr.io/${{ github.repository }}/tt-mlir-ubuntu-20-04:latest
options: --user root
steps:
- uses: actions/checkout@v4
- name: Display working directory
run: |
echo "Current working directory: $(pwd)"
echo "GitHub workspace: ${{ github.workspace }}"
ccache -show-config || true
ccache -show-stats || true
which cmake++-17 || true
which cmake++ || true
which cmake-17 || true
which cmake || true
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
shell: bash
run: |
source env/activate
cmake -G Ninja \
-B ${{ steps.strings.outputs.build-output-dir }} \
-DCMAKE_CXX_COMPILER=clang++-17 \
-DCMAKE_C_COMPILER=clang-17 \
-DCMAKE_BUILD_TYPE=${{ matrix.build.build_type }} \
-DTTMLIR_ENABLE_RUNTIME=${{ matrix.build.enable_runtime }} \
-DTTMLIR_ENABLE_RUNTIME_TESTS=${{ matrix.build.enable_runtime }} \
-S ${{ steps.strings.outputs.work-dir }}
- name: Build
shell: bash
run: |
source env/activate
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build.build_type }}
- name: Lint
shell: bash
run: |
source env/activate
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build.build_type }} -- clang-tidy
- name: Run Test
shell: bash
run: |
source env/activate
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build.build_type }} -- check-ttmlir
- name: Upload Test Report
uses: actions/upload-artifact@v4
with:
name: test-reports
path: build/test/report.xml
- name: Show Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: build/test/report.xml
check_name: MLIR Tests