-
-
Notifications
You must be signed in to change notification settings - Fork 15
30 lines (26 loc) · 826 Bytes
/
checkFormat.yml
File metadata and controls
30 lines (26 loc) · 826 Bytes
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
# Check that only correctly formatted golang code is merged
name: Check Format
on:
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-24.04
steps:
- name: CPU Info
run: |
cat /proc/cpuinfo
echo "Number of cores: $(nproc)"
echo "Number of threads: $(nproc --all)"
- uses: actions/checkout@v4
with:
# fetch branches and history so `git merge-base` in check-format-on-diff works correctly
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "^1.22" # The Go version to download (if necessary) and use.
check-latest: true
- name: Check formatting
shell: bash
run: tools/format/check-format-on-diff.sh --simplify --branch origin/${{ github.base_ref }}