Skip to content

Commit

Permalink
Add workflow to track LLVM commits (#2801)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeLyon committed Mar 26, 2022
1 parent a0a2ef9 commit 36cfcc9
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/trackLLVMChanges.yml
@@ -0,0 +1,81 @@
name: Track LLVM Changes

on:
schedule:
# 10:00 AM UTC is 3AM Pacific Time
- cron: '0 10 * * *'
# Run this workflow on pull requests which change this workflow
pull_request:
paths:
- .github/workflows/trackLLVMChanges.yml
workflow_dispatch:

jobs:
track-llvm-changes:
name: Track LLVM Changes
runs-on: ubuntu-20.04
steps:
# Clone the CIRCT repo and its submodules. Do shallow clone to save clone
# time.
- name: Get CIRCT
uses: actions/checkout@v2
with:
fetch-depth: 2
submodules: "true"

- name: Configure Project
run: |
mkdir build
cd build
cmake ../llvm/llvm \
-DLLVM_USE_LINKER=lld \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_RULE_MESSAGES=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_INSTALL_UTILS=OFF \
-DLLVM_ENABLE_OCAMLDOC=OFF \
-DLLVM_ENABLE_BINDINGS=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_EXTERNAL_PROJECTS=circt \
-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=$PWD/..
- name: Build current LLVM commit
id: build-current-llvm-commit
run: |
cd llvm
echo "::set-output name=sha::$(git rev-parse HEAD)"
cmake --build ../build --config Debug --target check-circt -- -j$(nproc)
- name: Build latest LLVM commit
id: build-latest-llvm-commit
continue-on-error: true
run: |
cd llvm
git fetch origin main
git checkout --detach origin/main
echo "::set-output name=sha::$(git rev-parse HEAD)"
cmake --build ../build --config Debug --target check-circt -- -j$(nproc)
- name: Bisect commits
if: steps.build-latest-llvm-commit.outcome != 'success'
run: |
cd llvm
git bisect start ${{ steps.build-latest-llvm-commit.outputs.sha }} ${{ steps.build-current-llvm-commit.outputs.sha }} -- mlir llvm
git bisect run cmake --build ../build --config Debug --target check-circt -- -j$(nproc)
# Summarize Results (re-run tests to make the log easier to parse)
- name: Summarize Results
if: steps.build-latest-llvm-commit.outcome != 'success'
run: |
cd llvm
git bisect log
FIRST_BAD_COMMIT=$(git bisect log | sed -n 's/# first bad commit: \[\([0-9a-f]*\)\].*/\1/p')
git checkout $FIRST_BAD_COMMIT
cmake --build ../build --config Debug --target check-circt -- -j$(nproc)
# --- end of track-llvm-changes job.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -3,6 +3,8 @@
[![](https://github.com/llvm/circt/workflows/Build%20and%20Test/badge.svg?event=push)](https://github.com/llvm/circt/actions?query=workflow%3A%22Build+and+Test%22)
[![Nightly integration tests](https://github.com/llvm/circt/workflows/Nightly%20integration%20tests/badge.svg)](https://github.com/llvm/circt/actions?query=workflow%3A%22Nightly+integration+tests%22)

[![Track LLVM Changes](https://github.com/llvm/circt/actions/workflows/trackLLVMChanges.yml/badge.svg)](https://github.com/llvm/circt/actions/workflows/trackLLVMChanges.yml) <br>↳ If failing, there exists an upstream LLVM commit which breaks CIRCT.

# ⚡️ "CIRCT" / Circuit IR Compilers and Tools

"CIRCT" stands for "Circuit IR Compilers and Tools". One might also interpret
Expand Down

0 comments on commit 36cfcc9

Please sign in to comment.