-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (34 loc) · 1.16 KB
/
linter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: lint-and-build
on: push
jobs:
clang-lint:
name: Lint code base
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run clang-format-lint
uses: DoozyX/clang-format-lint-action@v0.11
with:
source: '.'
exclude: './build'
clangFormatVersion: 10
inplace: True
- name: Check build
run: docker run -i --volume $GITHUB_WORKSPACE:/src/sg-bridge:z --workdir /src/sg-bridge fedora:latest /bin/sh -c 'sh ./build/build_checks.sh'
- name: Commit in-place changes based on linting recommendations
uses: EndBug/add-and-commit@v9
with:
author_name: InfraWatch CI
author_email: robot@infra.watch
message: 'Committing clang-format changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-build-check:
name: Check Dockerfile results in successful build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check build of Dockerfile is successful
run: docker build -t sg-bridge:check-build -f build/Dockerfile .