From 561c8b82dc4568308d0e7f18f4ed98741157e42f Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Sun, 31 Mar 2024 12:23:52 +0200 Subject: [PATCH] ci: server: verify deps are coherent with the commit --- .github/workflows/server.yml | 39 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index f07d25536..1109eae44 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -11,12 +11,12 @@ on: push: branches: - master - paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*'] - pull_request: + paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*'] + pull_request_target: types: [opened, synchronize, reopened] - paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*'] + paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*'] schedule: - - cron: '0 0 * * *' + - cron: '2 4 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -44,25 +44,44 @@ jobs: options: --cpus 4 steps: - - name: Clone - id: checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Dependencies id: depends run: | apt-get update apt-get -y install \ build-essential \ + xxd \ git \ cmake \ python3-pip \ + curl \ wget \ language-pack-en \ libcurl4-openssl-dev + - name: Clone + id: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Verify server deps + id: verify_server_deps + run: | + git config --global --add safe.directory $(realpath .) + cd examples/server + git ls-files --others --modified + git status + ./deps.sh + git status + not_ignored_files="$(git ls-files --others --modified)" + echo "Modified files: ${not_ignored_files}" + if [ -n "${not_ignored_files}" ]; then + echo "Repository is dirty or server deps are not built as expected" + echo "${not_ignored_files}" + exit 1 + fi + - name: Build id: cmake_build run: |