• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Formatting
2
3on:
4  push:
5    branches:
6      - main
7  pull_request:
8    types:
9      - opened
10      - synchronize
11
12jobs:
13  code-format-checks:
14    runs-on: ubuntu-latest
15    steps:
16      - uses: actions/checkout@v2
17      - uses: DoozyX/clang-format-lint-action@v0.14
18        with:
19          source: '.'
20          extensions: 'h,c,cc,proto'
21          clangFormatVersion: 14
22      - uses: actionsx/prettier@v2
23        with:
24          args: --config "${{ github.workspace }}/.prettierrc.toml" --write "**/*.{js,ts}"
25      # Prettier has no diff view so we must make one ourselves
26      # https://github.com/prettier/prettier/issues/6885
27      - run: |
28          git diff
29          if [[ -n "$(git status --porcelain)" ]]; then
30            exit 1
31          fi
32