ROLU modified to also run with no trigger and online spectra added #176
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: static analysis | |
on: | |
push: | |
branches: [ dev ] | |
pull_request: | |
branches: [ dev ] | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
# This workflow contains a single job called "clang-format" | |
clang-format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Code formatting | |
run: | | |
cd $GITHUB_WORKSPACE | |
sudo apt-get update | |
sudo apt-get install clang-format-15 | |
./util/clang-format-check.sh clang-format-15 | |
shell: bash | |
clang-tidy: | |
runs-on: ubuntu-latest | |
container: | |
image: yanzhaowang/cvmfs_clang:v15 | |
volumes: | |
- /tmp:/cvmfs | |
env: | |
CVMDIR: /cvmfs/fairsoft.gsi.de | |
options: --user root --privileged --ulimit nofile=10000:10000 --cap-add SYS_ADMIN --device /dev/fuse | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: pre-build | |
uses: './.github/actions/pre-build' | |
- name: install deps | |
id: restore-caching | |
uses: './.github/actions/install-deps' | |
with: | |
repo: 'false' | |
- name: configure r3broot | |
uses: './.github/actions/r3bbuild-steps' | |
with: | |
build-needed: 'false' | |
- name: clang-tidy check | |
run: | | |
mkdir -p clang-tidy-result | |
git diff -U0 HEAD^ | python3 $PWD/util/clang-tidy-diff.py -p1 -path build -j4 -use-color \ | |
-iregex '.*\.(cpp|cc|c\+\+|cxx|cl|h|hh|hpp|m|mm|inc)' \ | |
> clang-tidy-result/fixes.yml | |
cat clang-tidy-result/fixes.yml |\ | |
sed -e 's/\x1b\[[0-9;]*m//g' |\ | |
sed 's/\(^.*\):\([0-9]*\):\([0-9]*\): warning:/::warning file=\1,line=\2,col=\3::/' |\ | |
sed 's/\(^.*\):\([0-9]*\):\([0-9]*\): error:/::error file=\1,line=\2,col=\3::/' | |
echo "WARN_NUM=$(sed -e 's/\x1b\[[0-9;]*m//g' clang-tidy-result/fixes.yml | grep -w " warning:" | wc -l | xargs)" >> $GITHUB_ENV | |
echo "ERROR_NUM=$(sed -e 's/\x1b\[[0-9;]*m//g' clang-tidy-result/fixes.yml | grep -w " error:" | wc -l | xargs)" >> $GITHUB_ENV | |
- name: clang-tidy results | |
run: | | |
if [ "${{ env.WARN_NUM }}" -eq "0" ] && [ "${{ env.ERROR_NUM }}" -eq "0" ]; then | |
echo "::notice::All clean, LGTM!" | |
else | |
cat clang-tidy-result/fixes.yml | sed -e 's/\x1b\[[0-9;]*mnote: \x1b\[0m/\x1b\[33mnote: \x1b\[0m/g' | |
echo "::notice::Clang-tidy generates ${{ env.WARN_NUM }} warnings and ${{ env.ERROR_NUM }} errors! Please fix them before being merged." | |
exit 1 | |
fi | |
shell: bash | |