Skip to content

Commit be1bcb9

Browse files
authored
Reuse code, fix Coverity scans (#334)
* Reuse code, fix Coverity scans * Reuse code, fix Coverity scans * Reuse code, fix Coverity scans * Reuse code, fix Coverity scans
1 parent 748b698 commit be1bcb9

File tree

4 files changed

+32
-30
lines changed

4 files changed

+32
-30
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: setup-mlir-python-bindings
2+
description: Fetch and setup MLIR Python bindings
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set LLVM hash
7+
shell: bash
8+
run: |
9+
echo LLVM_HASH=$(cat cmake/llvm-version.txt) >>$GITHUB_ENV
10+
11+
- name: Fetch requirements for python binding
12+
uses: actions/checkout@v4
13+
with:
14+
repository: llvm/llvm-project
15+
ref: ${{ env.LLVM_HASH }}
16+
sparse-checkout: mlir/python/requirements.txt
17+
sparse-checkout-cone-mode: false
18+
path: llvm-dep
19+
20+
- name: Install requirements
21+
shell: bash
22+
run: python3 -m pip install -r llvm-dep/mlir/python/requirements.txt

.github/workflows/build-gpu-imex.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,9 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- name: Set LLVM hash
26-
run: |
27-
echo LLVM_HASH=$(cat cmake/llvm-version-imex.txt) >>$GITHUB_ENV
28-
29-
- name: Fetch requirements for python binding
30-
uses: actions/checkout@v4
31-
with:
32-
repository: llvm/llvm-project
33-
ref: ${{ env.LLVM_HASH }}
34-
sparse-checkout: mlir/python/requirements.txt
35-
sparse-checkout-cone-mode: false
36-
path: llvm-dep
37-
38-
- name: Install requirements
39-
run: python3 -m pip install -r llvm-dep/mlir/python/requirements.txt
25+
- name: Setup MLIR Python bindings
26+
id: setup-mlir-python-bindings
27+
uses: ./.github/actions/setup-mlir-python-bindings
4028

4129
- name: Build
4230
run: |

.github/workflows/build.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,9 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- name: Set LLVM hash
26-
run: |
27-
echo LLVM_HASH=$(cat cmake/llvm-version.txt) >>$GITHUB_ENV
28-
29-
- name: Fetch requirements for python binding
30-
uses: actions/checkout@v4
31-
with:
32-
repository: llvm/llvm-project
33-
ref: ${{ env.LLVM_HASH }}
34-
sparse-checkout: mlir/python/requirements.txt
35-
sparse-checkout-cone-mode: false
36-
path: llvm-dep
37-
38-
- name: Install requirements
39-
run: python3 -m pip install -r llvm-dep/mlir/python/requirements.txt
25+
- name: Setup MLIR Python bindings
26+
id: setup-mlir-python-bindings
27+
uses: ./.github/actions/setup-mlir-python-bindings
4028

4129
- name: Build
4230
run: |

.github/workflows/coverity.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ jobs:
5353
echo "email=$email" | tee -a $GITHUB_ENV
5454
echo "version=$version" | tee -a $GITHUB_ENV
5555
56+
- name: Setup MLIR Python bindings
57+
id: setup-mlir-python-bindings
58+
uses: ./.github/actions/setup-mlir-python-bindings
59+
5660
- name: Run coverity build
5761
run: |
5862

0 commit comments

Comments
 (0)