Repository navigation
96 lines (88 loc) · 3.06 KB
/
Copy pathlinting.yml
File metadata and controls
96 lines (88 loc) · 3.06 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Linting
on:
push:
branches:
- amd-staging
- amd-mainline
- 'release/rocm-rel*'
pull_request:
branches:
- amd-staging
- amd-mainline
- 'release/rocm-rel*'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
CLANG_FORMAT: /usr/lib/llvm-18/bin/clang-format
jobs:
call-workflow-passing-data:
name: Documentation
uses: ROCm/rocm-docs-core/.github/workflows/linting.yml@develop # zizmor: ignore[unpinned-uses]
cmake-formatting:
name: CMake File Formatting
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
python3 -m pip install gersemi
- name: Run gersemi
run: |
gersemi --check --definitions cmake/HipPlatform.cmake .
if [ $? -ne 0 ]; then
echo "CMake files are not formatted correctly. Please run gersemi ..."
echo "For example: \`gersemi -i .\`"
exit 1
fi
make-formatting:
name: Makefile Formatting
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check indentation
run: |
Scripts/CodeFormat/check_make.sh
source-formatting:
name: Source Code Formatting
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y git wget
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee -a /etc/apt/sources.list.d/llvm-18.list
sudo echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee -a /etc/apt/sources.list.d/llvm-18.list
sudo apt-get update -qq
sudo apt-get install -y clang-format-18
sudo apt-get install -y clang-tools-18 # Install git-clang-format
- name: Fetch all branches
run: git fetch --all
- name: Run clang-format
env:
GIT_CLANG_FORMAT: /usr/lib/llvm-18/bin/git-clang-format
run: | # zizmor: ignore[template-injection]
git config --global --add safe.directory $GITHUB_WORKSPACE
Scripts/CodeFormat/check_format.sh --all-files origin/`if [[ "${{ github.event_name }}" == "push" ]]; then echo "develop"; else echo "${{ github.base_ref }}"; fi` --binary ${{env.CLANG_FORMAT}}