Generate static analysis report #1206
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: Generate static analysis report | |
on: | |
schedule: | |
- cron: '21 4 * * *' | |
# - cron: '0 5 * * *' | |
# - push | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Test scenario tags' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: prepare the environment | |
env: | |
SECRET_SSH_KEY: ${{ secrets.VPP_COVERITY_REPORT_PRIVATE_SSH_KEY }} | |
ENV_REPORT_LOGIN_USER: ${{ secrets.ENV_REPORT_LOGIN_USER }} | |
ENV_REPORT_LOGIN_PASS: ${{ secrets.ENV_REPORT_LOGIN_PASS }} | |
run: | | |
sudo mkdir /run/user/$(id -u) || true | |
sudo chown $(whoami) /run/user/$(id -u) | |
sudo apt-get update | |
sudo apt-get install -y coreutils jq strace | |
sudo apt-get install -y xvfb | |
echo "$SECRET_SSH_KEY" >secret_ssh_key | |
chmod 600 secret_ssh_key | |
wget https://github.com/ayourtch/cov-watchdog/releases/download/v0.0.4/cov-watchdog | |
wget https://github.com/ayourtch/cov-retrieve-vpp/releases/download/v0.0.3/cov-retrieve-vpp | |
wget https://git.fd.io/vpp/plain/MAINTAINERS | |
chmod +x cov-watchdog | |
chmod +x cov-retrieve-vpp | |
ssh-agent bash -c 'ssh-add secret_ssh_key; git clone [email protected]:vpp-dev/vpp-coverity-report.git' | |
- name: Get the JSON file | |
env: | |
SECRET_SSH_KEY: ${{ secrets.VPP_COVERITY_REPORT_PRIVATE_SSH_KEY }} | |
COVERITY_USER: ${{ secrets.COVERITY_USER }} | |
COVERITY_PASS: ${{ secrets.COVERITY_PASS }} | |
run: | | |
env | grep COVERITY_USER | sha1sum | |
env | grep COVERITY_PASS | sha1sum | |
for TRY in $(seq 1 5); do | |
echo "Try number $TRY" | |
if ./cov-retrieve-vpp >/tmp/report.json; then | |
break | |
fi | |
echo "Attempt failed, sleep for a couple of minutes" | |
sleep 120 | |
done | |
- name: Generate the report | |
run: | | |
echo "======= BEG REPORT =======" | |
cat /tmp/report.json | |
echo "======= END REPORT =======" | |
./cov-watchdog -i /tmp/report.json -m MAINTAINERS -l >vpp-coverity-report/REPORT-GENERATED.md | |
sed -i.bak '/^# Open Issues$/,$d' vpp-coverity-report/README.md | |
# re-add the line we have just deleted | |
echo "# Open Issues" >>vpp-coverity-report/README.md | |
cat vpp-coverity-report/REPORT-GENERATED.md >>vpp-coverity-report/README.md | |
- name: Push the new report | |
env: | |
SECRET_SSH_KEY: ${{ secrets.VPP_COVERITY_REPORT_PRIVATE_SSH_KEY }} | |
run: | | |
cd vpp-coverity-report | |
git config user.email "[email protected]" | |
git config user.name "Andrew Yourtchenko (ghjobs)" | |
git add REPORT-GENERATED.md || true | |
git commit -a -m "Auto-update at $(date)" | |
ssh-agent bash -c 'ssh-add ../secret_ssh_key; git push origin main' | |