Skip to content

Commit

Permalink
Extend GitHub Actions to build and test P4MLIR
Browse files Browse the repository at this point in the history
Also configured cache for LLVM.

Signed-off-by: Bili Dong <qobilidop@gmail.com>
  • Loading branch information
qobilidop committed Oct 7, 2024
1 parent ed80a83 commit 04ea3c9
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,43 @@ jobs:
- name: Enable ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}
key: ${{ runner.os }}

# --------
# Build and test MLIR. Use cache when available.
# --------

- name: Get LLVM hash
id: get-llvm-hash
run: echo "hash=$(git rev-parse @:./third_party/llvm-project)" >> $GITHUB_OUTPUT

- name: Get workflow hash
id: get-workflow-hash
run: echo "hash=$(md5sum $GITHUB_WORKSPACE/.github/workflows/build-and-test.yml | awk '{print $1}')" >> $GITHUB_OUTPUT

- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: |
third_party/llvm-project/build/bin/llvm-lit
install
key: ${{ runner.os }}-llvm-${{ steps.get-llvm-hash.outputs.hash }}-${{ steps.get-workflow-hash.outputs.hash }}

- name: Install requirements
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
build_tools/ubuntu_install_mlir_requirements.sh
- name: Build MLIR
- name: Build and test MLIR
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
build_tools/build_mlir.sh
# --------
# Build and test P4MLIR.
# --------

- name: Build and test P4MLIR
run: |
build_tools/build_p4mlir.sh

0 comments on commit 04ea3c9

Please sign in to comment.