Skip to content

Commit

Permalink
use separate CI workflow to check code format
Browse files Browse the repository at this point in the history
also fix typo in branch name (v1.x, not 1.x)

remove PR event types from CI triggers
  • Loading branch information
2bndy5 committed Feb 17, 2024
1 parent 40f2ff0 commit 3f0a4db
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 37 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@ name: Arduino CLI build

on:
pull_request:
branches: [master, 1.x]
types: [opened, reopened]
branches: [master, v1.x]
paths:
- ".github/workflows/build_arduino.yml"
- "examples/**"

push:
branches: [master, 1.x]
branches: [master, v1.x]
paths:
- ".github/workflows/build_arduino.yml"
- "examples/**"

jobs:
check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: '!examples|'
extensions: ino

build:
needs: check_formatting
uses: nRF24/.github/.github/workflows/build_arduino.yaml@main
with:
sketch-paths: |
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Linux build

on:
pull_request:
branches: [master, 1.x]
types: [opened, reopened]
branches: [master, v1.x]
paths:
- "*.h"
- "*.cpp"
Expand All @@ -16,7 +15,7 @@ on:
- "pyRF24Mesh/*"
- ".github/workflows/build_linux.yml"
push:
branches: [master, 1.x]
branches: [master, v1.x]
paths:
- "*.h"
- "*.cpp"
Expand All @@ -36,13 +35,8 @@ env:
BUILD_TYPE: Release

jobs:
check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: 'examples|examples_pico'

using_cmake:
needs: check_formatting
uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main
with:
rf24mesh-ref: ${{ github.sha }}
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/build_platformIO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: PlatformIO build

on:
pull_request:
branches: [master, 1.x]
types: [opened, reopened]
branches: [master, v1.x]
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
- "examples/**"
- "!examples/old_backups/**"
- "!examples/rf24_ATTiny/**"
push:
branches: [master, 1.x]
branches: [master, v1.x]
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
Expand All @@ -28,13 +27,8 @@ jobs:
with:
deploy-release: ${{ github.event_name == 'release' }}

check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
extensions: ino

build:
needs: [check_formatting, validate_lib_json]
needs: [validate_lib_json]
uses: nRF24/.github/.github/workflows/build_platformio.yaml@main
with:
example-path: ${{ matrix.example }}
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/build_rp2xxx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pico SDK build

on:
push:
branches: [master, 1.x]
branches: [master, v1.x]
paths:
- ".github/workflows/build_rp2xxx.yml"
- "*.h"
Expand All @@ -11,8 +11,7 @@ on:
- "cmake/"
- "examples_pico/*"
pull_request:
branches: [master, 1.x]
types: [opened, reopened]
branches: [master, v1.x]
paths:
- ".github/workflows/build_rp2xxx.yml"
- "*.h"
Expand All @@ -22,13 +21,8 @@ on:
- "examples_pico/*"

jobs:
check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: '!examples_pico|'

build:
needs: check_formatting
uses: nRF24/.github/.github/workflows/build_pico_sdk.yaml@main
with:
board-id: ${{ matrix.board }}
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: check code formatting

on:
push:
branches: [master, v1.x]
pull_request:
branches: [master, v1.x]

jobs:
check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: examples/old_backups|utility/RPi/bcm2835.h|utility/RPi/bcm2835.c
extensions: ino,c,cpp,h
5 changes: 2 additions & 3 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: build Docs

on:
pull_request:
branches: [master, 1.x]
types: [opened, reopened]
branches: [master, v1.x]
paths:
- "*.h"
- "docs/**"
Expand All @@ -16,7 +15,7 @@ on:
- "Doxyfile"
- "library.properties" # get lib version from here
push:
branches: [master, 1.x]
branches: [master, v1.x]
paths:
- "*.h"
- "docs/**"
Expand Down

0 comments on commit 3f0a4db

Please sign in to comment.