@@ -10,10 +10,18 @@ permissions:
10
10
contents : write
11
11
12
12
jobs :
13
- clang -format :
13
+ code -format :
14
14
runs-on : ubuntu-latest
15
15
container : ubuntu:20.04
16
16
steps :
17
+ - name : astyle
18
+ run : |
19
+ export DEBIAN_FRONTEND=noninteractive
20
+ apt-get update -y
21
+ apt-get install -y astyle git
22
+
23
+ - uses : actions/checkout@v4
24
+
17
25
- name : cache-clang-format
18
26
id : cache-clang-format
19
27
uses : actions/cache@v4
@@ -39,37 +47,20 @@ jobs:
39
47
rm -rf llvm-project-10.0.1
40
48
rm llvm-project-10.0.1.tar.xz
41
49
42
- code-format :
43
- needs : [clang-format]
44
- runs-on : ubuntu-latest
45
- steps :
46
- - uses : actions/checkout@v4
47
-
48
- - name : cache-clang-format
49
- id : cache-clang-format
50
- uses : actions/cache@v4
51
- with :
52
- path : clang-format-install
53
- key : clang-format-install-5
54
-
55
- - name : astyle
56
- run : |
57
- sudo apt-get update
58
- sudo apt-get install -y astyle
59
-
60
50
- name : code-format
61
51
run : |
62
- mkdir -p ~/bin
63
- mv $GITHUB_WORKSPACE/clang-format-install/clang-format ~/bin/clang-format
52
+ mv $GITHUB_WORKSPACE/clang-format-install/clang-format /usr/local/bin/clang-format
64
53
rm -rf $GITHUB_WORKSPACE/clang-format-install
65
- export PATH=~/bin:$PATH
66
54
sh codeformat.sh
67
55
56
+ - name : configure-git-safe-directory
57
+ run : git config --global --add safe.directory /__w/ncnn/ncnn
58
+
68
59
- uses : stefanzweifel/git-auto-commit-action@v5
69
60
with :
70
61
commit_message : apply code-format changes
71
62
72
63
- name : restore-clang-format-cache
73
64
run : |
74
65
mkdir $GITHUB_WORKSPACE/clang-format-install
75
- cp -r ~ /bin/clang-format $GITHUB_WORKSPACE/clang-format-install
66
+ cp -r /usr/local /bin/clang-format $GITHUB_WORKSPACE/clang-format-install
0 commit comments