mirror of
https://github.com/google/or-tools.git
synced 2026-03-27 14:11:16 +00:00
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
name: Check Format
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- v99bugfix
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{github.workflow}}-${{github.ref}}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# Building using the github runner environement directly.
|
|
clang-format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Fetch origin/main
|
|
run: git fetch origin main
|
|
- name: List of changed file(s)
|
|
run: git diff --name-only FETCH_HEAD
|
|
|
|
- name: Build clang-format docker
|
|
run: cd .github/workflows && docker build --tag=linter .
|
|
- name: Check clang-format
|
|
run: docker run --rm --init -v $(pwd):/repo linter:latest clang-format --version
|
|
- name: clang-format help
|
|
run: docker run --rm --init -v $(pwd):/repo linter:latest clang-format --help
|
|
|
|
- name: Check current commit
|
|
run: docker run --rm --init -v $(pwd):/repo -w /repo linter:latest sh -c "git diff --diff-filter=d --name-only FETCH_HEAD | grep '\.c$\|\.h$\|\.cc$\|\.java$\|\.cs$' | xargs clang-format --verbose --style=file --dry-run --Werror "
|