Skip to content

Commit ab32aaf

Browse files
committed
CI: Add clang-format job
1 parent 1e7872d commit ab32aaf

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.gitlab-ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,45 @@ test_build:
4747
- "while IFS= read -r line; do if [[ \"$line\" =~ $SYMBOL_REGEX ]]; then echo \"passed '$line'\"; else echo \"failed '$line'\"; FAILED=\"$FAILED,$line\"; fi; done <<< \"$EXPORTED_SYMBOLS\""
4848
- "if [[ -n \"$FAILED\" ]]; then echo \"$FAILED\"; exit 1; fi;"
4949

50+
lint_clang_format:
51+
image: xianpengshen/clang-tools:16
52+
stage: lint
53+
before_script:
54+
- apt-get -y update
55+
- apt-get -y install git
56+
script:
57+
- ls -lah
58+
- clang-format -i src/*.c
59+
- clang-format -i src/*.h
60+
- clang-format -i examples/*.c
61+
- clang-format -i include/*.h
62+
- git diff --exit-code
63+
rules:
64+
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
65+
when: always
66+
- when: never
67+
68+
test_build:
69+
image: ubuntu:latest
70+
stage: build
71+
before_script:
72+
- apt-get -y update
73+
- apt-get -y install build-essential autoconf libtool
74+
script:
75+
- echo "Build renamenoise"
76+
- ./autogen.sh
77+
- ./configure
78+
- make
79+
- echo "Apply noise suppression to test sample"
80+
- ./examples/renamenoise_demo ./sample/babble_15dB.pcm ./sample/renamenoise_babble_15dB.pcm
81+
- sha1sum -c --strict ./sample/CHECKSUMS
82+
- echo "Check exported symbols"
83+
- FAILED=""
84+
- EXPORTED_SYMBOLS=$(nm ./.libs/librenamenoise.a | awk '/ T / {print $3}' | sort)
85+
- "SYMBOL_REGEX='^_?renamenoise.*$'"
86+
- "while IFS= read -r line; do if [[ \"$line\" =~ $SYMBOL_REGEX ]]; then echo \"passed '$line'\"; else echo \"failed '$line'\"; FAILED=\"$FAILED,$line\"; fi; done <<< \"$EXPORTED_SYMBOLS\""
87+
- "if [[ -n \"$FAILED\" ]]; then echo \"$FAILED\"; exit 1; fi;"
88+
5089
test_build_no_vla:
5190
image: ubuntu:latest
5291
stage: build

0 commit comments

Comments
 (0)