Skip to content

Commit

Permalink
Merge pull request #8 from supapro/clang-format
Browse files Browse the repository at this point in the history
Update GitHub Actions structure
  • Loading branch information
p4vook authored Dec 6, 2020
2 parents 6b58aa3 + ee986be commit 694715a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
23 changes: 1 addition & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: ci
on:
pull_request: {}
push:
branches:
master
on: push

env:
BUILD_TYPE: release
Expand Down Expand Up @@ -46,20 +42,3 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
format:
if: github.head_ref != 'master'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup clang-format
run: sudo apt install clang-format
- name: Run clang-format
run: |
git fetch
git clang-format-9 -v --style file origin/${{ github.base_ref }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}
21 changes: 21 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pr
on:
pull_request: {}

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup clang-format
run: sudo apt install clang-format
- name: Run clang-format
run: |
git fetch
git clang-format-9 -v --style file origin/${{ github.base_ref }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}

0 comments on commit 694715a

Please sign in to comment.