11# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
22# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
33name : Test on Ubuntu Linux
4-
54on :
65 push :
7- branches : [ "master" ]
6+ branches : [ "master", "dev-new" ]
87 pull_request :
9- branches : [ "master" ]
8+ branches : [ "master", "dev-new"]
9+ workflow_dispatch :
1010
1111env :
1212 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1313 BUILD_TYPE : Release
1414 COMET_SRC : ${{github.workspace}}
15-
15+ COMETPY_COMET_PATH : ${{github.workspace}}/build/comet/
16+ COMETPY_LLVM_PATH : ${{github.workspace}}/build/llvm/src/llvm-build
1617jobs :
17- build-and-test-comet :
18+ build-comet- and-dependencies :
1819 # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
1920 # You can convert this to a matrix build if you need cross-platform coverage.
2021 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
@@ -33,51 +34,46 @@ jobs:
3334 with :
3435 path : |
3536 ${{github.workspace}}/llvm
36- ${{github.workspace}}/blis/
37- ${{github.workspace}}/install/
38- ${{github.workspace}}/build/
37+ ${{github.workspace}}/build/llvm
38+ ${{github.workspace}}/build/blis
3939 key : ${{ runner.os }}-submodules
4040
41- - name : Update git submodules
41+ - name : Build clean
4242 if : steps.cache-submodule.outputs.cache-hit != 'true'
43- uses : actions/checkout@v3
44- with :
45- submodules : recursive
43+ run : mkdir ${{github.workspace}}/build && cd ${{github.workspace}}/build && cmake ../ -DCMAKE_BUILD_TYPE=Release && make
4644
47- - name : Build llvm
48- if : steps.cache-submodule.outputs.cache-hit ! = 'true'
49- run : mkdir ${{github.workspace}}/llvm/ build && cd llvm/build/ && cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="mlir;openmp;clang" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release && ninja
45+ - name : Build from cached
46+ if : steps.cache-submodule.outputs.cache-hit = = 'true'
47+ run : cd ${{github.workspace}}/build && cmake ../ -DCMAKE_BUILD_TYPE=Release -DLLVM_CUSTOM_BUILD_PATH=${{github.workspace}}/build/llvm/src/llvm-build -DCMAKE_BUILD_TYPE=Release && make
5048
51- - name : Build blis
52- if : steps.cache-submodule.outputs.cache-hit != 'true'
53- run : cd ${{github.workspace}} && patch -s -p0 < comet-blis.patch && cd blis && ./configure --prefix=$COMET_SRC/install --disable-shared auto && make && make install
5449
55- - name : Build COMET
56- # Build your program with the given configuration
57- run : rm -rf ${{github.workspace}}/build && mkdir ${{github.workspace}}/build && cd ${{github.workspace}}/build && cmake -G Ninja .. -DMLIR_DIR=${{github.workspace}}/llvm/build/lib/cmake/mlir -DLLVM_DIR=${{github.workspace}}/llvm/build/lib/cmake/llvm -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release && ninja
50+ test-comet-backend :
5851
59- # test-comet-backend:
60-
61- # needs: build-comet
62- # runs-on: ubuntu-latest
52+ needs : build-comet-and-dependencies
53+ runs-on : ubuntu-latest
6354
64- # steps:
65- # - uses: actions/checkout@v4
66- # # - uses: lukka/get-cmake@latest
67- # - name: Install CMake
68- # run: sudo apt-get install cmake && sudo apt-get install ninja-build
55+ steps :
56+ - uses : actions/checkout@v4
57+ # - uses: lukka/get-cmake@latest
58+ - name : Install CMake
59+ run : sudo apt-get install cmake && sudo apt-get install ninja-build
6960
70- # - name: Cache Submodules
71- # id: cache-submodule
72- # uses: actions/cache@v4
73- # # if: always()
74- # with:
75- # path: |
76- # ${{github.workspace}}/llvm
77- # ${{github.workspace}}/blis/
78- # ${{github.workspace}}/install/
79- # ${{github.workspace}}/build/
80- # key: ${{ runner.os }}-submodules
61+
62+ - name : Cache Submodules
63+ id : cache-submodule
64+ uses : actions/cache@v4
65+ # if: always()
66+ with :
67+ path : |
68+ ${{github.workspace}}/llvm
69+ ${{github.workspace}}/build/llvm
70+ ${{github.workspace}}/build/blis
71+ key : ${{ runner.os }}-submodules
72+
73+ - name : Build COMET
74+ working-directory : ${{github.workspace}}/build/
75+ # Build your program with the given configuration
76+ run : cmake .. -DLLVM_CUSTOM_BUILD_PATH=${{github.workspace}}/build/llvm/src/llvm-build -DCMAKE_BUILD_TYPE=Release && make
8177
8278 - name : Initialize Python 3.11
8379 uses : actions/setup-python@v4
9187 sudo apt-get install -y python3-pip
9288
9389 - name : Test
94- working-directory : ${{github.workspace}}/build
90+ working-directory : ${{github.workspace}}/build/comet/
9591 shell : bash
9692
9793 run : ninja check-comet-integration
@@ -129,7 +125,7 @@ jobs:
129125 # cargo test
130126
131127 test-cometpy :
132- needs : build-and-test-comet
128+ needs : build-comet- and-dependencies
133129 runs-on : ubuntu-latest
134130 steps :
135131 - uses : actions/checkout@v4
@@ -141,9 +137,8 @@ jobs:
141137 with :
142138 path : |
143139 ${{github.workspace}}/llvm
144- ${{github.workspace}}/blis/
145- ${{github.workspace}}/install/
146- ${{github.workspace}}/build/
140+ ${{github.workspace}}/build/llvm
141+ ${{github.workspace}}/build/blis
147142 key : ${{ runner.os }}-submodules
148143
149144 - name : Initialize Python 3.11
@@ -152,10 +147,23 @@ jobs:
152147 with :
153148 python-version : 3.11
154149
150+ - name : Install python dependencies
151+ run : |
152+ sudo apt-get install -y python3-pip
153+
154+ - name : Build COMET
155+ working-directory : ${{github.workspace}}/build/
156+ # Build your program with the given configuration
157+ run : cmake .. -DLLVM_CUSTOM_BUILD_PATH=${{github.workspace}}/build/llvm/src/llvm-build -DCMAKE_BUILD_TYPE=Release && make
158+
159+
155160 - name : Setup cometPy
156161 run : cd ${{github.workspace}}/frontends/numpy-scipy/ && pip3 install -e .
157-
162+
163+ - name : Install PyTest
164+ run : pip3 install -U pytest
165+
158166 - name : Test CometPy
159167 working-directory : ${{github.workspace}}/frontends/numpy-scipy/integration_tests/
160168
161- run : python3 numpy_integration.py -v
169+ run : pytest
0 commit comments