mirror of
https://github.com/The-OpenROAD-Project/OpenROAD.git
synced 2026-06-02 01:08:34 +08:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [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/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
30 lines
868 B
YAML
30 lines
868 B
YAML
name: Format Code with pre commit trigger
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
Clang-Format:
|
|
runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }}
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v47
|
|
- name: Check format of cpp changed files
|
|
run: |
|
|
clang-format --version
|
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
|
if [[ "${file##*.}" =~ ^(h|C|cc|cp|cpp|c++|CPP|cxx|hh)$ && "${file}" != "src/sta/"* && "${file}" != "src/odb/src/codeGenerator/"* ]]; then
|
|
clang-format --dry-run --Werror $file
|
|
fi
|
|
done
|