Skip to content

ci: Linter

ci: Linter #1

Workflow file for this run

name: Linting and extra checks
on: [push, workflow_dispatch]
jobs:
run_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up compiler
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: Get all source files
run: echo "SRC='$(find src -name "*.[ch]" -o -path src/flamingo -prune -type f)'" >> $GITHUB_ENV
- name: Build (with LSP output)
run: intercept-build sh build.sh
- name: Run clang-tidy
run: clang-tidy $SRC
- name: Make sure 'mkdir_wrapped' is used everywhere (except for once for 'fsutils.c')
run: |
if [ $(cat $SRC | grep "[^\"]mkdir(" | wc -l) -gt 1 ]; then
echo "Error: 'mkdir' is used in multiple places. Use 'mkdir_wrapped' instead."
exit 1
fi