-
Notifications
You must be signed in to change notification settings - Fork 185
51 lines (41 loc) · 1.22 KB
/
code-format.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: code-format
on: [pull_request]
concurrency:
group: code-format-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
code-format:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0"
- name: Set dotnet version
run: |
cd ${{github.workspace}}
sh set_dotnet_version.sh 7
- name: Install Formatters
run: |
sudo apt-get update
sudo apt-get install -y clang-format-11
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 110
dotnet tool update -g dotnet-format
- name: Format C++ & C#
run: |
export CLANG_FORMAT_LLVM_INSTALL_DIR=/usr
bash tools/clang-format.sh
dotnet format -v diag
- name: Format Python
id: autopep8
uses: peter-evans/autopep8@v1
with:
args: --recursive --in-place tests python
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply code-format changes