-
Notifications
You must be signed in to change notification settings - Fork 10
44 lines (40 loc) · 1.3 KB
/
format.yaml
File metadata and controls
44 lines (40 loc) · 1.3 KB
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
41
42
name: format_check
on:
push:
branches:
- main
pull_request:
# Cancel in-progress CI jobs when a new commit is pushed to a PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
format_check:
runs-on: ubuntu-latest
steps:
# --- Build the project for release
# Checkout repo to Github Actions runner
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-formatters
with:
path: ./formatters/
key: ${{ runner.os }}-formatters-${{ hashFiles('./ci/setup_linux_format.sh') }}
- run: ./ci/setup_linux_format.sh
if: steps.cache-formatters.outputs.cache-hit != 'true'
- run: |
sudo apt-get install -y clang
echo "CC=$(which clang)" >> $GITHUB_ENV
echo "CXX=$(which clang++)" >> $GITHUB_ENV
name: "Install Clang"
- name: configure bazelrc
run: mkdir tmp/ && echo "build --config=ci" > tmp/ci-bazelrc
- name: test
run: PATH=./formatters:$PATH make format
env:
LD_LIBRARY_PATH: ./formatters/swift/usr/lib
- name: check diff
run: git --no-pager diff && git diff --quiet
- name: Check license headers
run: ci/check_license.sh