mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Unlike "which", which is a separate executable not always installed by
default, "command -v" is a shell built-in available at least for bash,
dash, and busybox shell.
Unlike "which", "command -v" is also easier to grep for, and it is
already used in a few places here.
Inspired by commit 57251d811.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
name: Run code linter
|
|
|
|
on: [push, pull_request]
|
|
|
|
# Cancel any preceding run on the pull request.
|
|
concurrency:
|
|
group: lint-test-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: registry.fedoraproject.org/fedora:latest
|
|
steps:
|
|
- name: Install tools
|
|
run: sudo dnf -y install git make ruff xz clang-tools-extra codespell git-clang-format ShellCheck
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set git safe directory
|
|
# https://github.com/actions/checkout/issues/760
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
- name: Run make lint
|
|
run: make lint
|
|
|
|
- name: Run make indent
|
|
continue-on-error: true
|
|
run: |
|
|
if [ -z "${{github.base_ref}}" ]; then
|
|
git fetch --deepen=1
|
|
make indent
|
|
else
|
|
git fetch origin ${{github.base_ref}}
|
|
make indent BASE=origin/${{github.base_ref}}
|
|
fi
|
|
- name: Raise in-line make indent warnings
|
|
run: |
|
|
git diff | ./scripts/github-indent-warnings.py
|