Skip to content

Commit e52a305

Browse files
phymberthodlen
authored andcommitted
ci: server: verify deps are coherent with the commit (ggml-org#6409)
* ci: server: verify deps are coherent with the commit * ci: server: change the ref to build as now it's a pull event target
1 parent 1b4ade6 commit e52a305

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

.github/workflows/server.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@ name: Server
44
on:
55
workflow_dispatch: # allows manual triggering
66
inputs:
7+
sha:
8+
description: 'Commit SHA1 to build'
9+
required: false
10+
type: string
711
slow_tests:
812
description: 'Run slow tests'
913
required: true
1014
type: boolean
1115
push:
1216
branches:
1317
- master
14-
paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*']
15-
pull_request:
18+
paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*']
19+
pull_request_target:
1620
types: [opened, synchronize, reopened]
17-
paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*']
21+
paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*']
1822
schedule:
19-
- cron: '0 0 * * *'
23+
- cron: '2 4 * * *'
2024

2125
concurrency:
2226
group: ${{ github.workflow }}-${{ github.ref }}
@@ -44,25 +48,45 @@ jobs:
4448
options: --cpus 4
4549

4650
steps:
47-
- name: Clone
48-
id: checkout
49-
uses: actions/checkout@v3
50-
with:
51-
fetch-depth: 0
52-
5351
- name: Dependencies
5452
id: depends
5553
run: |
5654
apt-get update
5755
apt-get -y install \
5856
build-essential \
57+
xxd \
5958
git \
6059
cmake \
6160
python3-pip \
61+
curl \
6262
wget \
6363
language-pack-en \
6464
libcurl4-openssl-dev
6565
66+
- name: Clone
67+
id: checkout
68+
uses: actions/checkout@v3
69+
with:
70+
fetch-depth: 0
71+
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
72+
73+
- name: Verify server deps
74+
id: verify_server_deps
75+
run: |
76+
git config --global --add safe.directory $(realpath .)
77+
cd examples/server
78+
git ls-files --others --modified
79+
git status
80+
./deps.sh
81+
git status
82+
not_ignored_files="$(git ls-files --others --modified)"
83+
echo "Modified files: ${not_ignored_files}"
84+
if [ -n "${not_ignored_files}" ]; then
85+
echo "Repository is dirty or server deps are not built as expected"
86+
echo "${not_ignored_files}"
87+
exit 1
88+
fi
89+
6690
- name: Build
6791
id: cmake_build
6892
run: |

0 commit comments

Comments
 (0)