Skip to content

Commit

Permalink
ci: Improve CI trigger and concurrency
Browse files Browse the repository at this point in the history
Outdated CI jobs will now be cancelled and a workflow is only run if
relevant files were changed.
Additionally, the CI only runs on pull requests to the main branch.
  • Loading branch information
taminob committed Mar 28, 2024
1 parent a985561 commit f6baba5
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 15 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/cmake-lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: "CMake Lint"

on:
push:
paths-ignore:
- 'README.md'
pull_request:
branches: [ main ]
paths:
- '**/CMakeLists.txt'

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

jobs:
lint:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/cpp-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
name: "C++ Build"

on:
push:
paths-ignore:
- 'README.md'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'include/**'
- 'test/**'
- 'examples/**'
- 'CMakeLists.txt'

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

jobs:
build:
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/cpp-lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: "C++ Lint"

on:
push:
paths-ignore:
- 'README.md'
pull_request:
branches: [ main ]
paths:
- 'src/**/*.cpp'
- 'include/**/*.h'
- 'test/**/*.cpp'
- 'test/**/*.h'
- 'examples/**/*.cpp'
- 'examples/**/*.h'

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

jobs:
lint:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/cpp-unittest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
name: "C++ Unittests"

on:
push:
paths-ignore:
- 'README.md'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'include/**'
- 'test/**'
- 'CMakeLists.txt'

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


jobs:
unittest:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: "C++/CMake Format"

on:
push:
paths-ignore:
- 'README.md'
pull_request:
branches: [ main ]
paths:
- '**/*.cpp'
- '**/*.h'
- '**/CMakeLists.txt'

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

jobs:
format:
Expand Down

0 comments on commit f6baba5

Please sign in to comment.