Skip to content

Commit 422aa2e

Browse files
committed
improve enzyme-ci
1 parent d79e612 commit 422aa2e

File tree

1 file changed

+45
-31
lines changed

1 file changed

+45
-31
lines changed

.github/workflows/enzyme-ci.yml

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,26 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- '.github/workflows/enzyme-bazel.yml'
9+
- 'enzyme/Enzyme/**'
10+
- 'enzyme/includes/**'
11+
- 'enzyme/test/**'
12+
- 'enzyme/tools/**'
13+
- 'enzyme/benchmarks/**'
14+
- 'enzyme/cmake/**'
15+
- 'enzyme/CMakeLists.txt'
16+
- 'enzyme/CMakePresets.json'
717
pull_request:
18+
branches:
19+
- main
20+
paths:
21+
- '.github/workflows/enzyme-bazel.yml'
22+
- 'enzyme/Enzyme/**'
23+
- 'enzyme/includes/**'
24+
- 'enzyme/test/**'
25+
- 'enzyme/BUILD'
26+
- 'enzyme/WORKSPACE'
827
merge_group:
928

1029
jobs:
@@ -24,28 +43,28 @@ jobs:
2443
steps:
2544
- name: add llvm
2645
run: |
27-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
28-
sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main" || true
29-
sudo apt-get install -y cmake gcc g++ llvm-${{ matrix.llvm }}-dev libzstd-dev
46+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
47+
sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main"
48+
sudo apt-get install -y cmake ninja-build llvm-${{ matrix.llvm }}-dev
3049
sudo python3 -m pip install --upgrade pip lit
3150
- uses: actions/checkout@v4
3251
- name: mkdir
33-
run: rm -rf build && mkdir build
52+
run: mkdir build
3453
- name: cmake
3554
working-directory: build
36-
run: cmake ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`which lit` -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm
37-
- name: make
55+
run: cmake -G Ninja ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`which lit` -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm
56+
- name: build
3857
working-directory: build
39-
run: make -j `nproc`
40-
- name: make check-typeanalysis
58+
run: ninja
59+
- name: check-typeanalysis
4160
working-directory: build
42-
run: make -j `nproc` check-typeanalysis
43-
- name: make check-activityanalysis
61+
run: ninja check-typeanalysis
62+
- name: ninja check-activityanalysis
4463
working-directory: build
45-
run: make -j `nproc` check-activityanalysis
46-
- name: make check-enzyme
64+
run: ninja check-activityanalysis
65+
- name: check-enzyme
4766
working-directory: build
48-
run: make -j `nproc` check-enzyme-bench
67+
run: ninja check-enzyme-bench
4968

5069
build-macos:
5170
name: Enzyme CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} macOS
@@ -60,28 +79,25 @@ jobs:
6079
timeout-minutes: 30
6180
steps:
6281
- name: add llvm
63-
run: |
64-
brew update
65-
brew install llvm@${{ matrix.llvm }} make cmake
66-
sudo python3 -m pip install --upgrade --break-system-packages --user pip lit requests
82+
run: brew install llvm@${{ matrix.llvm }} ninja-build cmake lit
6783
- uses: actions/checkout@v4
6884
- name: mkdir
69-
run: rm -rf build && mkdir build
85+
run: mkdir build
7086
- name: cmake
7187
working-directory: build
72-
run: cmake ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`find /Users/runner/Library/Python/ -iname lit` -DLLVM_DIR=`brew --prefix llvm@${{ matrix.llvm }}`/lib/cmake/llvm
73-
- name: make
88+
run: cmake -G Ninja ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`which lit` -DLLVM_DIR=`brew --prefix llvm@${{ matrix.llvm }}`/lib/cmake/llvm
89+
- name: build
7490
working-directory: build
75-
run: make -j 3
76-
- name: make check-typeanalysis
91+
run: ninja
92+
- name: check-typeanalysis
7793
working-directory: build
78-
run: make -j 3 check-typeanalysis
79-
- name: make check-activityanalysis
94+
run: ninja check-typeanalysis
95+
- name: check-activityanalysis
8096
working-directory: build
81-
run: make -j 3 check-activityanalysis
82-
- name: make check-enzyme
97+
run: ninja check-activityanalysis
98+
- name: check-enzyme
8399
working-directory: build
84-
run: make -j3 check-enzyme-bench
100+
run: ninja check-enzyme-bench
85101

86102
build-xcode:
87103
name: Enzyme CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} macOS XCode
@@ -96,12 +112,10 @@ jobs:
96112
timeout-minutes: 30
97113
steps:
98114
- name: add llvm
99-
run: |
100-
brew install llvm@${{ matrix.llvm }} make cmake gcc
101-
sudo python3 -m pip install --upgrade --break-system-packages --user pip lit
115+
run: brew install llvm@${{ matrix.llvm }} make cmake lit
102116
- uses: actions/checkout@v4
103117
- name: mkdir
104-
run: rm -rf build && mkdir build
118+
run: mkdir build
105119
- name: cmake
106120
working-directory: build
107121
run: |

0 commit comments

Comments
 (0)