Building inside docker container #11
Workflow file for this run
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 | |
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 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Display working directory | |
run: | | |
echo "Current working directory: $(pwd)" | |
echo "GitHub workspace: ${{ github.workspace }}" | |
ccache -show-config || 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: Git safe dir | |
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }} | |
- name: Configure CMake | |
shell: bash | |
run: | | |
source env/activate | |
cmake -G Ninja \ | |
-B ${{ steps.strings.outputs.build-output-dir }} \ | |
-DCMAKE_CXX_COMPILER=clang++ \ | |
-DCMAKE_C_COMPILER=clang \ | |
-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 |