GHA: add a checksrc job

This job unconditionally runs checksrc on ALL .c and .h files present in
git.

checksrc.pl: fixed to look for ".checksrc" in the same directory from
where it loads the file to check so that it an be invoked like this

Closes #14625
This commit is contained in:
Daniel Stenberg 2024-08-21 09:19:27 +02:00
parent 99ba50d9c4
commit 23749bfd04
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 42 additions and 2 deletions

29
.github/workflows/checksrc.yml vendored Normal file
View file

@ -0,0 +1,29 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: checksrc
on:
# Trigger the workflow on push or pull requests, but only for the
# master branch
push:
branches:
- master
- '*/ci'
pull_request:
branches:
- master
permissions: {}
jobs:
all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: check
run: git ls-files "*.[ch]" | xargs -n1 ./scripts/checksrc.pl