From 84fdc1f815d04a4f1757f7ad92c5d18a1d5f664c Mon Sep 17 00:00:00 2001 From: Danilo Egea Gondolfo Date: Thu, 10 Aug 2023 14:10:33 +0100 Subject: [PATCH] github: add a scheduled action to run Coverity It will run every Monday and automatically upload the results. The token and email needed are stored as Github secrets. --- .github/workflows/coverity.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/coverity.yml diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 000000000..24eb0f899 --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,32 @@ +name: Coverity + +on: + schedule: + - cron: '0 0 * * MON' + +jobs: + coverity: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list + sudo apt update + sudo apt -y build-dep netplan.io + sudo apt -y install libcmocka-dev meson python3-pytest curl + - name: Download Coverity + run: | + curl https://scan.coverity.com/download/cxx/linux64 --no-progress-meter --output ${HOME}/coverity.tar.gz --data "token=${{ secrets.COVERITY_TOKEN }}&project=Netplan" + mkdir ${HOME}/coverity + tar --strip=1 -C ${HOME}/coverity -xzf ${HOME}/coverity.tar.gz + echo "$HOME/coverity/bin" >> $GITHUB_PATH + - name: Run Coverity + run: | + meson setup coveritybuild --prefix=/usr + cov-build --dir cov-int meson compile -C coveritybuild + tar czf netplan.tar.gz cov-int + - name: Upload results + run: | + curl --form token=${{ secrets.COVERITY_TOKEN }} --form email=${{ secrets.COVERITY_EMAIL }} --form file=@netplan.tar.gz --form version="0.106" --form description="Coverity scan" https://scan.coverity.com/builds?project=Netplan