Skip to content

Commit 8442af1

Browse files
committed
Simplify CMake instructions
1 parent bcf56fd commit 8442af1

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

.github/workflows/build-oneapi.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,22 @@ jobs:
4949
- name: CMake
5050
run: |
5151
. /opt/intel/oneapi/setvars.sh
52-
mkdir repo/build
53-
cd repo/build
54-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_FLAGS="-Ofast -xCORE-AVX2" -DCMAKE_CXX_FLAGS="-Ofast -xCORE-AVX2" -DLLAMA_NATIVE=OFF -DLLAMA_STATIC=ON -DLLAMA_BUILD_SERVER=ON
55-
cmake --build . --config Release --target server -j ${{ steps.cpu-cores.outputs.count }}
56-
strip bin/server
52+
cmake repo -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_FLAGS="-Ofast -xCORE-AVX2" -DCMAKE_CXX_FLAGS="-Ofast -xCORE-AVX2" -DLLAMA_NATIVE=OFF -DLLAMA_STATIC=ON -DLLAMA_BUILD_SERVER=ON
53+
cmake --build build --config Release --target server -j ${{ steps.cpu-cores.outputs.count }}
54+
strip build/bin/server
5755
5856
- name: Upload build artifact
5957
uses: actions/upload-artifact@v4
6058
with:
6159
name: server-${{ matrix.ssl }}-oneapi
62-
path: repo/build/bin/server
60+
path: build/bin/server
6361
if-no-files-found: error
6462

6563
- name: Build and push Docker image
6664
uses: macbre/push-to-ghcr@v13
6765
with:
6866
dockerfile: .devops/server.Dockerfile
69-
context: repo/build/bin
67+
context: build/bin
7068
image_name: ${{ github.repository }}
7169
image_tag: server-${{ matrix.ssl }}-oneapi
7270
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}

.github/workflows/build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,23 @@ jobs:
5858

5959
- name: CMake
6060
run: |
61-
mkdir repo/build
62-
cd repo/build
63-
cmake .. -DCMAKE_BUILD_TYPE=Release -DLLAMA_NATIVE=OFF -DLLAMA_STATIC=ON -DLLAMA_BUILD_SERVER=ON ${{ matrix.ssl_defines }} ${{ matrix.avx_defines }}
64-
cmake --build . --config Release --target server -j ${{ steps.cpu-cores.outputs.count }}
65-
strip bin/server
61+
cmake repo -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_NATIVE=OFF -DLLAMA_STATIC=ON -DLLAMA_BUILD_SERVER=ON ${{ matrix.ssl_defines }} ${{ matrix.avx_defines }}
62+
cmake --build build --config Release --target server -j ${{ steps.cpu-cores.outputs.count }}
63+
strip build/bin/server
6664
shell: alpine.sh {0}
6765

6866
- name: Upload build artifact
6967
uses: actions/upload-artifact@v4
7068
with:
7169
name: server-${{ matrix.ssl }}-${{ matrix.avx }}
72-
path: repo/build/bin/server
70+
path: build/bin/server
7371
if-no-files-found: error
7472

7573
- name: Build and push Docker image
7674
uses: macbre/push-to-ghcr@v13
7775
with:
7876
dockerfile: .devops/server.Dockerfile
79-
context: repo/build/bin
77+
context: build/bin
8078
image_name: ${{ github.repository }}
8179
image_tag: server-${{ matrix.ssl }}-${{ matrix.avx }}
8280
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)