-
Notifications
You must be signed in to change notification settings - Fork 467
29 lines (24 loc) · 995 Bytes
/
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
name: Lint Code Base
on: [pull_request]
jobs:
build:
name: Lint Code Base
runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }}
steps:
- name: Fetch target branch and PR branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Find most recent ancestor of PR and target branch
id: common_ancestor
run: echo "commit_sha=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: false
# TODO Only install clang-format
- name: Install dependencies
uses: numworks/setup-llvm@latest
- name: Lint files changed by PR
run: make format BASE=${{ steps.common_ancestor.outputs.commit_sha }} CXXFORMATARGS="--dry-run --Werror"