Files
mscclpp/.github/workflows/lint.yml
Changho Hwang 8d54bf3301 Update CI (#79)
2023-05-21 11:45:41 -07:00

50 lines
1.3 KiB
YAML

name: Lint
on:
pull_request:
branches:
- '**'
jobs:
cpplint:
runs-on: ubuntu-20.04
steps:
- name: Check git version
env:
min-ver: "2.18"
run: dpkg --compare-versions $(git version | awk '{print $3}') ge ${{ env.min-ver }}
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install ClangFormat
run: sudo apt-get install -y clang-format-12
- name: Run cpplint
run: |
CPPSOURCES=$(find ./ -regextype posix-extended -regex '.*\.(c|cpp|h|hpp|cc|cxx|cu)' -not -path "./build/*" -not -path "./python/*" -not -path "./test/*")
PYTHONCPPSOURCES=$(find ./python/src/ -regextype posix-extended -regex '.*\.(c|cpp|h|hpp|cc|cxx|cu)')
clang-format-12 -style=file --verbose --Werror --dry-run ${CPPSOURCES}
clang-format-12 --dry-run ${PYTHONCPPSOURCES}
spelling:
runs-on: ubuntu-20.04
steps:
- name: Check git version
env:
min-ver: "2.18"
run: dpkg --compare-versions $(git version | awk '{print $3}') ge ${{ env.min-ver }}
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
curl -L https://git.io/misspell | sudo bash -s -- -b /bin
- name: Check spelling
run: |
misspell -error .