Skip to content

Commit

Permalink
Create a reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Feb 18, 2024
1 parent 4c7fef1 commit f874fe7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: Format

on:
Expand All @@ -9,15 +6,4 @@ on:

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install system hooks
run: sudo apt install -qq cppcheck
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
uses: ./.github/workflows/reusable-ci-format.yml
24 changes: 24 additions & 0 deletions .github/workflows/reusable-ci-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action
# The pre-commit configuration is in .pre-commit-config.yaml

on:
workflow_call:

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
env:
AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install system hooks
run: sudo apt install -qq clang-format-14 cppcheck
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual

0 comments on commit f874fe7

Please sign in to comment.