mirror of
https://github.com/pion/webrtc.git
synced 2025-09-26 19:21:12 +08:00
Update CI configs to v0.7.5
Update lint scripts and CI configs.
This commit is contained in:
1
.github/hooks/pre-commit.sh
vendored
1
.github/hooks/pre-commit.sh
vendored
@@ -10,3 +10,4 @@
|
||||
exec 1>&2
|
||||
|
||||
.github/lint-disallowed-functions-in-library.sh
|
||||
.github/lint-no-trailing-newline-in-log-messages.sh
|
||||
|
41
.github/lint-no-trailing-newline-in-log-messages.sh
vendored
Executable file
41
.github/lint-no-trailing-newline-in-log-messages.sh
vendored
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Disallow usages of functions that cause the program to exit in the library code
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
if [ -f ${SCRIPT_PATH}/.ci.conf ]
|
||||
then
|
||||
. ${SCRIPT_PATH}/.ci.conf
|
||||
fi
|
||||
|
||||
files=$(
|
||||
find "$SCRIPT_PATH/.." -name "*.go" \
|
||||
| while read file
|
||||
do
|
||||
excluded=false
|
||||
for ex in $EXCLUDE_DIRECTORIES
|
||||
do
|
||||
if [[ $file == */$ex/* ]]
|
||||
then
|
||||
excluded=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
$excluded || echo "$file"
|
||||
done
|
||||
)
|
||||
|
||||
if grep -E '\.(Trace|Debug|Info|Warn|Error)f?\("[^"]*\\n"\)?' $files | grep -v -e 'nolint'; then
|
||||
echo "Log format strings should have trailing new-line"
|
||||
exit 1
|
||||
fi
|
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
@@ -18,6 +18,14 @@ jobs:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# The code in examples/ might intentionally do things like log credentials
|
||||
# in order to show how the library is used, aid in debugging etc. We
|
||||
# should ignore those for CodeQL scanning, and only focus on the package
|
||||
# itself.
|
||||
- name: Remove example code
|
||||
run: |
|
||||
rm -rf examples/
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
|
3
.github/workflows/lint.yaml
vendored
3
.github/workflows/lint.yaml
vendored
@@ -36,6 +36,9 @@ jobs:
|
||||
- name: Functions
|
||||
run: .github/lint-disallowed-functions-in-library.sh
|
||||
|
||||
- name: Logging messages should not have trailing newlines
|
||||
run: .github/lint-no-trailing-newline-in-log-messages.sh
|
||||
|
||||
lint-go:
|
||||
name: Go
|
||||
runs-on: ubuntu-latest
|
||||
|
Reference in New Issue
Block a user