-
Notifications
You must be signed in to change notification settings - Fork 464
33 lines (27 loc) · 1.08 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
name: Lint Code Base
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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 and black
- name: Setup
run: build/setup.sh --only-simulator
- name: Lint files changed by PR
run: make format BASE=${{ steps.common_ancestor.outputs.commit_sha }} CXXFORMATARGS="--dry-run --Werror" PYFORMATARGS="--check"