[X2Go-Commits] [nx-libs] 253/429: Move PVS run to GitHub Actions

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:44 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 3da6e9c3a348cc3ffe20701e389fd2046d0d4e1d
Author: Mario Trangoni <mjtrangoni at gmail.com>
Date:   Sun Jan 31 11:07:07 2021 +0100

    Move PVS run to GitHub Actions
    
    Signed-off-by: Mario Trangoni <mjtrangoni at gmail.com>
---
 .github/workflows/linters.yml | 62 ++++++++++++++++++++++++++++++++++++++++---
 .github/workflows/nx-libs.yml |  2 +-
 .pvs-studio.sh                | 37 --------------------------
 3 files changed, 59 insertions(+), 42 deletions(-)

diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index 936db9c8b..183924dfd 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -8,14 +8,14 @@ on:
 
 jobs:
   shellcheck:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     steps:
       - name: Checkout repository
         uses: actions/checkout at v2
 
       - name: Install linters on ubuntu
         run: |
-          sudo apt-get update
+          sudo apt-get update -q -y
           sudo apt-get install shellcheck
 
       - name: run Shellcheck
@@ -23,14 +23,14 @@ jobs:
           find . -name "*.sh" | xargs shellcheck || true
 
   cppcheck:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     steps:
       - name: Checkout repository
         uses: actions/checkout at v2
 
       - name: Install linters on ubuntu
         run: |
-          sudo apt-get update
+          sudo apt-get update -q -y
           sudo apt-get install cppcheck
 
       - name: run cppcheck
@@ -45,3 +45,57 @@ jobs:
           CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc'
           echo "$(cppcheck --version):";
           cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .;
+  pvs:
+    environment: pvs
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout at v2
+
+      - name: Install linters on ubuntu
+        env:
+          DEBIAN_FRONTEND: noninteractive
+        run: |
+          sudo apt-get update -qq -y
+          # compiler
+          sudo apt-get install -qq -y gcc g++
+          # basic packages
+          sudo apt-get install -qq -y \
+            autoconf libtool make pkg-config
+          # imake deps
+          sudo apt-get install -qq -y \
+            libxkbfile-dev xfonts-utils xutils-dev
+          # X11 libraries deps
+          sudo apt-get install -qq -y \
+            libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \
+            libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \
+            libxtst-dev x11proto-fonts-dev
+          # soft requirements
+          sudo apt-get install -qq -y \
+            quilt x11-xkb-utils
+          # PVS
+          sudo wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add -
+          sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
+          sudo apt-get update -qq
+          sudo apt-get install -qq pvs-studio
+
+      - name: Run PVS-Studio Analyzer
+        shell: bash
+        env:
+          PVS_USERNAME: ${{ secrets.PVS_USERNAME }}
+          PVS_KEY: ${{ secrets.PVS_KEY }}
+        run: |
+          # check environment variables
+          if [[ -z "${PVS_USERNAME}" ]]; then
+            echo '"PVS_USERNAME" environment variable not set'
+            exit 0
+          elif [[ -z "${PVS_KEY}" ]]; then
+            echo '"PVS_KEY" environment variable not set'
+            exit 0
+          else
+            pvs-studio-analyzer credentials -o "PVS-Studio.lic" "${PVS_USERNAME}" "${PVS_KEY}"
+            pvs-studio-analyzer trace -- make
+            pvs-studio-analyzer analyze --quiet --lic-file "PVS-Studio.lic" --output-file "PVS-Studio-${CC}.log"
+            plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log"
+            cat "PVS-Studio-${CC}.tasks"
+          fi
diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml
index 70177f419..5988f05c6 100644
--- a/.github/workflows/nx-libs.yml
+++ b/.github/workflows/nx-libs.yml
@@ -9,7 +9,7 @@ on:
 jobs:
   build:
     name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cc-version }}
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     container: ${{ matrix.cfg.container }}
     strategy:
       fail-fast: false
diff --git a/.pvs-studio.sh b/.pvs-studio.sh
deleted file mode 100644
index 9e9f0370c..000000000
--- a/.pvs-studio.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-before_install() {
-  if [ "$PVS_ANALYZE" = "yes" ]; then
-    sudo wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add -
-    sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
-    sudo apt-get update -qq
-    sudo apt-get install -qq pvs-studio
-  else
-    echo "not installing PVS-Studio"
-  fi
-}
-
-build_script() {
-  if [ "$PVS_ANALYZE" = "yes" ]; then
-    if [[ -z "${PVS_USERNAME}" ]]; then
-      echo '"PVS_USERNAME" environment variable not set'
-      exit 0
-    elif [[ -z "${PVS_KEY}" ]]; then
-      echo '"PVS_KEY" environment variable not set'
-      exit 0
-    else
-      pvs-studio-analyzer credentials -o "PVS-Studio.lic" "${PVS_USERNAME}" "${PVS_KEY}"
-      pvs-studio-analyzer trace -- make -j2
-      pvs-studio-analyzer analyze --quiet -j2 --lic-file "PVS-Studio.lic" --output-file "PVS-Studio-${CC}.log"
-      plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log"
-      cat "PVS-Studio-${CC}.tasks"
-    fi
-  else
-    make -j2
-  fi
-}
-
-set -e
-set -x
-
-$1;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list