Skip to content

Commit

Permalink
Merge branch 'master' into new-features
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Dec 7, 2023
2 parents a484d6d + 3682838 commit 4de68c0
Showing 1 changed file with 44 additions and 19 deletions.
63 changes: 44 additions & 19 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
---
name: Check code style

on:
push:
branches:
- master
- v*

paths:
- .clang-format
- source/**

pull_request:
paths:
- .clang-format
- source/**

- "source/**"
- ".github/workflows/clang-format.yml"
push:
paths:
- "source/**"
jobs:
check-format:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cancel Previous Runs
if: github.ref != 'refs/heads/master'
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content"
cancel_others: true

- name: Set up Git
if: ${{ github.ref != 'refs/heads/master' }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Actions checkout
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: sudo apt update -q && sudo apt install -yq clang-format
- name: Run clang format lint
if: ${{ github.ref != 'refs/heads/master' }}
uses: DoozyX/[email protected]
with:
source: "source"
extensions: "cpp,hpp,h"
clangFormatVersion: 16
inplace: true

- name: Check code style
run: clang-format -n -style=file --Werror source/*.{cpp,h}
- name: Run add and commit
if: ${{ github.ref != 'refs/heads/master' }}
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: "Code format - (Clang-format)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4de68c0

Please sign in to comment.