Skip to content

Commit f01be36

Browse files
committed
ci : extract clang jobs to build-clang.yml
1 parent e5eae54 commit f01be36

2 files changed

Lines changed: 99 additions & 63 deletions

File tree

.github/workflows/build-clang.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI (clang)
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
push:
6+
branches:
7+
- master
8+
paths: ['.github/workflows/build-clang.yml',
9+
'**/CMakeLists.txt',
10+
'**/Makefile',
11+
'**/*.mk',
12+
'**/*.cmake',
13+
'**/*.in',
14+
'**/*.h',
15+
'**/*.hpp',
16+
'**/*.c',
17+
'**/*.cpp',
18+
'**/*.cu',
19+
'**/*.cuh',
20+
'**/*.cl']
21+
22+
pull_request:
23+
types: [opened, synchronize, reopened]
24+
paths-ignore:
25+
- 'bindings/ruby/**' # handled by bindings-ruby.yml
26+
- 'bindings/go/**' # handled by bindings-go.yml
27+
- 'examples/addon.node/**' # handled by examples.yml
28+
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
31+
cancel-in-progress: true
32+
33+
env:
34+
ubuntu_image: "ubuntu:22.04"
35+
36+
jobs:
37+
ubuntu-22-clang:
38+
runs-on: ubuntu-22.04
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
build: [Debug, Release]
44+
#arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
45+
# TODO: arm/v7 disabled due to clang bug
46+
# https://github.com/ggerganov/whisper.cpp/actions/runs/9657764109/job/26637633042?pr=2256#step:4:1990
47+
arch: [linux/amd64, linux/ppc64le]
48+
49+
steps:
50+
- name: Clone
51+
uses: actions/checkout@v6
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v3
55+
56+
- name: Build ${{ matrix.arch }}
57+
run: |
58+
docker run --platform ${{ matrix.arch }} --rm \
59+
-v ${{ github.workspace }}:/workspace \
60+
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
61+
set -e
62+
export DEBIAN_FRONTEND=noninteractive
63+
sed -i "s|archive.ubuntu.com|mirrors.kernel.org|g" /etc/apt/sources.list
64+
sed -i "s|security.ubuntu.com|mirrors.kernel.org|g" /etc/apt/sources.list
65+
66+
apt update
67+
apt install -y clang build-essential cmake libsdl2-dev git
68+
cmake . -DWHISPER_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
69+
make
70+
ctest -L gh --output-on-failure'
71+
72+
ubuntu-22-clang-arm64:
73+
runs-on: ubuntu-22.04-arm
74+
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
build: [Debug, Release]
79+
80+
steps:
81+
- name: Clone
82+
uses: actions/checkout@v6
83+
84+
- name: Install dependencies
85+
run: |
86+
sudo apt-get update
87+
sudo apt-get install -y clang build-essential cmake libsdl2-dev git
88+
89+
- name: Build and Test
90+
run: |
91+
cmake . -DWHISPER_SDL2=ON \
92+
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
93+
-DCMAKE_CXX_COMPILER=clang++ \
94+
-DCMAKE_C_COMPILER=clang \
95+
-DGGML_NATIVE=OFF \
96+
-DGGML_CPU_ARM_ARCH=armv8-a
97+
make
98+
ctest -L gh --output-on-failure

.github/workflows/build.yml

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ on:
3737
- '.github/workflows/build-linux.yml' # handled by build-linux.yml
3838
- '.github/workflows/build-macos.yml' # handled by build-macos.yml
3939
- '.github/workflows/build-gcc.yml' # handled by build-gcc.yml
40+
- '.github/workflows/build-clang.yml' # handled by build-clang.yml
4041

4142
concurrency:
4243
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
@@ -65,69 +66,6 @@ jobs:
6566
# cmake -B build
6667
# cmake --build build --config Release
6768

68-
ubuntu-22-clang:
69-
runs-on: ubuntu-22.04
70-
71-
strategy:
72-
fail-fast: false
73-
matrix:
74-
build: [Debug, Release]
75-
#arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
76-
# TODO: arm/v7 disabled due to clang bug
77-
# https://github.com/ggerganov/whisper.cpp/actions/runs/9657764109/job/26637633042?pr=2256#step:4:1990
78-
arch: [linux/amd64, linux/ppc64le]
79-
80-
steps:
81-
- name: Clone
82-
uses: actions/checkout@v6
83-
84-
- name: Set up QEMU
85-
uses: docker/setup-qemu-action@v3
86-
87-
- name: Build ${{ matrix.arch }}
88-
run: |
89-
docker run --platform ${{ matrix.arch }} --rm \
90-
-v ${{ github.workspace }}:/workspace \
91-
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
92-
set -e
93-
export DEBIAN_FRONTEND=noninteractive
94-
sed -i "s|archive.ubuntu.com|mirrors.kernel.org|g" /etc/apt/sources.list
95-
sed -i "s|security.ubuntu.com|mirrors.kernel.org|g" /etc/apt/sources.list
96-
97-
apt update
98-
apt install -y clang build-essential cmake libsdl2-dev git
99-
cmake . -DWHISPER_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
100-
make
101-
ctest -L gh --output-on-failure'
102-
103-
ubuntu-22-clang-arm64:
104-
runs-on: ubuntu-22.04-arm
105-
106-
strategy:
107-
fail-fast: false
108-
matrix:
109-
build: [Debug, Release]
110-
111-
steps:
112-
- name: Clone
113-
uses: actions/checkout@v6
114-
115-
- name: Install dependencies
116-
run: |
117-
sudo apt-get update
118-
sudo apt-get install -y clang build-essential cmake libsdl2-dev git
119-
120-
- name: Build and Test
121-
run: |
122-
cmake . -DWHISPER_SDL2=ON \
123-
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
124-
-DCMAKE_CXX_COMPILER=clang++ \
125-
-DCMAKE_C_COMPILER=clang \
126-
-DGGML_NATIVE=OFF \
127-
-DGGML_CPU_ARM_ARCH=armv8-a
128-
make
129-
ctest -L gh --output-on-failure
130-
13169
ubuntu-22-cmake-sycl:
13270
runs-on: ubuntu-22.04
13371

0 commit comments

Comments
 (0)