openmv/.github/workflows/codeformat.yml
dependabot[bot] 3cab1804b2
build(deps): bump actions/cache from 3.3.1 to 3.3.2
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 16:42:53 +00:00

66 lines
1.5 KiB
YAML

name: '🔎 Check Code Formatting'
on:
push:
branches:
- 'master'
paths:
- 'src/**'
- '!**/README.md'
- '!**.rst'
pull_request:
types:
- opened
- edited
- reopened
- synchronize
branches:
- 'master'
jobs:
formatting-check:
runs-on: ubuntu-20.04
steps:
- name: '⏳ Checkout repository'
uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
- name: '♻ Caching dependencies'
uses: actions/cache@v3.3.2
id: cache
with:
path: ~/cache/deps/bin
key: 'uncrustify'
- name: '🛠 Install dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: source tools/ci.sh && ci_install_code_format_deps
- name: '📜 Get list of changed files'
id: changed-files
uses: tj-actions/changed-files@v39
with:
files: |
src/**/*.c
src/**/*.h
!src/hal/**
!src/uvc/**
!src/lib/**
!src/drivers/**
!src/micropython/**
!src/stm32cubeai/**
- name: '📜 Show list of changed files'
run: |
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash
- name: '🔎 Check code formatting'
if: steps.changed-files.outputs.any_changed == 'true'
run: |
source tools/ci.sh && ci_run_code_format_check ${{ steps.changed-files.outputs.all_changed_files }}