Skip to content

Commit

Permalink
GitHub Actions infrastructure for formatting checks (#1055)
Browse files Browse the repository at this point in the history
* add pre-commit config

* GitHub Actions starting with pre-commit
  • Loading branch information
berquist authored Mar 12, 2024
1 parent fa138fe commit 08e1a33
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: ci

# yamllint disable-line rule:truthy
on:
push:
pull_request:

concurrency:
group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true

jobs:
prechecks:
uses: ./.github/workflows/pre-commit.yml
all-prechecks:
needs: [prechecks]
runs-on: ubuntu-latest
steps:
- name: Success
run: "true"
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: pre-commit

# yamllint disable-line rule:truthy
on:
workflow_call:

concurrency:
group: style-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
fail_fast: false
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: "v0.6.13"
hooks:
- id: cmake-format
args: [--config-files, experimental/.cmake-format.yaml]
additional_dependencies:
- pyyaml
- id: cmake-lint
additional_dependencies:
- pyyaml
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v12.0.1"
hooks:
- id: clang-format
types_or: [c++, c]
exclude: |
(?x)(
build/|
src/sst/core/libltdl/|
external/
)
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: "v1.6.26.11"
hooks:
- id: actionlint

0 comments on commit 08e1a33

Please sign in to comment.