-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1.32 KB
/
norminette.yaml
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
40
# This is a basic linter workflow
# that runs on every push.
name: norminette
# Controls when the action will run.
# Right now, the action occurs whenever
# we push to any branch on this repository;
on: push
# A workflow run is made up of one or more jobs that
# can run sequentially or in parallel.
jobs:
linter:
runs-on: ubuntu-18.04
steps:
- name: Checkout to project repository
uses: actions/checkout@v2
- name: Checkout linter from public repository
uses: actions/checkout@v2
with:
repository: 42sp/norminette-client
path: linter
- name: Set up Ruby version
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install ruby gem bundler
run: gem install bundler
- name: Install norminette ruby gem
run: (cd linter; bundle)
- name: Runs norminette linter
run: |
# Runs norminette with every .c or .h file on the root dir and its subdirectiores
find . -type f \( -name \*.c -o -name \*.h \) -exec sh -c 'linter/norminette.rb {}' \; | tee output
echo "NORM_ERRORS=$(grep -E 'Error|Warning' output | wc -l)" >> $GITHUB_ENV
- name: Checks norminette linter result
run: |
echo "Norminette errors found: $NORM_ERRORS"
[[ $NORM_ERRORS == 0 ]]