mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
51 lines
2.0 KiB
YAML
51 lines
2.0 KiB
YAML
name: clang-format
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
clang-format-job:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Set apt mirror
|
|
# GitHub Actions apt proxy is super unstable
|
|
# see https://github.com/actions/runner-images/issues/7048
|
|
run: |
|
|
# make sure there is a `\t` between URL and `priority:*` attributes
|
|
printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt
|
|
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
|
|
sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list
|
|
|
|
- name: Install clang-format 19
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install --option="APT::Acquire::Retries=3" clang-format-19
|
|
clang-format-19 --version
|
|
- uses: actions/checkout@v7
|
|
- name: Check format - ApplicationLibCode
|
|
run: |
|
|
cd ApplicationLibCode
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-19 -i
|
|
git diff
|
|
- name: Check format - ApplicationExeCode
|
|
run: |
|
|
cd ApplicationExeCode
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-19 -i
|
|
git diff
|
|
- name: Check format - AppFwk
|
|
run: |
|
|
cd Fwk/AppFwk
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | grep -v gtest | xargs clang-format-19 -i
|
|
git diff
|
|
- name: Check format - GrpcInterface
|
|
run: |
|
|
cd GrpcInterface
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' -o -name '*.proto' | grep -v gtest | xargs clang-format-19 -i
|
|
git diff
|
|
- uses: peter-evans/create-pull-request@v8
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: "Fixes by clang-format"
|
|
title: "Fixes by clang-format"
|
|
branch: clang-format-patches
|
|
branch-suffix: random
|