-
Notifications
You must be signed in to change notification settings - Fork 55
37 lines (35 loc) · 987 Bytes
/
linter.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
name: Linter
on:
push:
branches-ignore:
- master
pull_request_target:
workflow_dispatch:
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Install requirements
run: sudo apt-get install clang-format
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install black
run: pip install black pyyaml mapfile-parser==2.1.4
- name: Clone main repo (PR)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: false
- name: Clone main repo
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: false
- name: Format code
run: make format
- name: Check for pending changes
run: git diff --exit-code