From e0e999f4ccfdb633199c35223802f39569586482 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sat, 19 Dec 2020 17:01:34 +0100 Subject: Implement github actions basics --- .github/workflows/nx-libs.yml | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/nx-libs.yml diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml new file mode 100644 index 000000000..cc4878498 --- /dev/null +++ b/.github/workflows/nx-libs.yml @@ -0,0 +1,56 @@ +name: nx-libs CI + +on: + push: + branches: [ 3.6.x ] + pull_request: + branches: [ 3.6.x ] + +jobs: + build: + name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cpp-version }} + runs-on: ubuntu-latest + container: ${{ matrix.cfg.container }} + strategy: + fail-fast: false + matrix: + cfg: + - { container: 'ubuntu:16.04', cpp-version: gcc } + - { container: 'ubuntu:16.04', cpp-version: clang } + - { container: 'ubuntu:20.04', cpp-version: gcc } + - { container: 'ubuntu:20.04', cpp-version: clang } + - { container: 'debian:stable', cpp-version: gcc } + - { container: 'debian:stable', cpp-version: clang } + - { container: 'debian:sid', cpp-version: gcc } + - { container: 'debian:sid', cpp-version: clang } + - { container: 'centos:7', cpp-version: gcc } + - { container: 'centos:7', cpp-version: clang } + - { container: 'centos:8', cpp-version: gcc } + - { container: 'centos:8', cpp-version: clang } + - { container: 'fedora:latest', cpp-version: gcc } + - { container: 'fedora:latest', cpp-version: clang } + + steps: + - name: Install compiler ${{ matrix.cfg.cpp-version }} + shell: sh + run: | + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + cat /etc/debian_version + apt-get update -q -y + apt-get install -q -y ${{ matrix.cfg.cpp-version }} + ${{ matrix.cfg.cpp-version }} --version + ;; + fedora*) + cat /etc/fedora-release + dnf -y update + dnf -y install ${{ matrix.cfg.cpp-version }} + ${{ matrix.cfg.cpp-version }} --version + ;; + centos*) + cat /etc/centos-release + yum -y update + yum -y install ${{ matrix.cfg.cpp-version }} + ${{ matrix.cfg.cpp-version }} --version + ;; + esac -- cgit v1.2.3 From 763a9ee0ef774114f06e57edb3869ba5bfed6feb Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sat, 30 Jan 2021 18:07:40 +0100 Subject: Add build jobs on containers Signed-off-by: Mario Trangoni --- .github/workflows/nx-libs.yml | 217 +++++++++++++++++++++++++++++++++--------- 1 file changed, 171 insertions(+), 46 deletions(-) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index cc4878498..70177f419 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -7,50 +7,175 @@ on: branches: [ 3.6.x ] jobs: - build: - name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cpp-version }} - runs-on: ubuntu-latest - container: ${{ matrix.cfg.container }} - strategy: - fail-fast: false - matrix: - cfg: - - { container: 'ubuntu:16.04', cpp-version: gcc } - - { container: 'ubuntu:16.04', cpp-version: clang } - - { container: 'ubuntu:20.04', cpp-version: gcc } - - { container: 'ubuntu:20.04', cpp-version: clang } - - { container: 'debian:stable', cpp-version: gcc } - - { container: 'debian:stable', cpp-version: clang } - - { container: 'debian:sid', cpp-version: gcc } - - { container: 'debian:sid', cpp-version: clang } - - { container: 'centos:7', cpp-version: gcc } - - { container: 'centos:7', cpp-version: clang } - - { container: 'centos:8', cpp-version: gcc } - - { container: 'centos:8', cpp-version: clang } - - { container: 'fedora:latest', cpp-version: gcc } - - { container: 'fedora:latest', cpp-version: clang } + build: + name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cc-version }} + runs-on: ubuntu-latest + container: ${{ matrix.cfg.container }} + strategy: + fail-fast: false + matrix: + cfg: + - { container: 'ubuntu:16.04', cc-version: gcc } + - { container: 'ubuntu:16.04', cc-version: clang } + - { container: 'ubuntu:20.04', cc-version: gcc } + - { container: 'ubuntu:20.04', cc-version: clang } + - { container: 'debian:stable', cc-version: gcc } + - { container: 'debian:stable', cc-version: clang } + - { container: 'debian:sid', cc-version: gcc } + - { container: 'debian:sid', cc-version: clang } + - { container: 'centos:7', cc-version: gcc } + - { container: 'centos:7', cc-version: clang } + - { container: 'centos:8', cc-version: gcc } + - { container: 'centos:8', cc-version: clang } + - { container: 'fedora:latest', cc-version: gcc } + - { container: 'fedora:latest', cc-version: clang } - steps: - - name: Install compiler ${{ matrix.cfg.cpp-version }} - shell: sh - run: | - case "${{ matrix.cfg.container }}" in - ubuntu*|debian*) - cat /etc/debian_version - apt-get update -q -y - apt-get install -q -y ${{ matrix.cfg.cpp-version }} - ${{ matrix.cfg.cpp-version }} --version - ;; - fedora*) - cat /etc/fedora-release - dnf -y update - dnf -y install ${{ matrix.cfg.cpp-version }} - ${{ matrix.cfg.cpp-version }} --version - ;; - centos*) - cat /etc/centos-release - yum -y update - yum -y install ${{ matrix.cfg.cpp-version }} - ${{ matrix.cfg.cpp-version }} --version - ;; - esac + steps: + - name: Install compiler ${{ matrix.cfg.cc-version }} + shell: sh + env: + DEBIAN_FRONTEND: noninteractive + run: | + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + cat /etc/debian_version + apt-get update -q -y + apt-get install -q -y ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + case "${{ matrix.cfg.cc-version }}" in + gcc) + apt-get install -q -y g++ + ;; + esac + ;; + fedora*) + cat /etc/fedora-release + dnf -y update + dnf -y install ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + ;; + centos:8) + cat /etc/centos-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + dnf -y update + dnf -y install ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + ;; + centos:7) + cat /etc/centos-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + yum -y update + yum -y install ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + ;; + esac + + - name: Install nx-libs dependencies ${{ matrix.cfg.cc-version }} + shell: sh + env: + DEBIAN_FRONTEND: noninteractive + run: | + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + # basic packages + apt-get install -q -y \ + autoconf libtool make pkg-config + # imake deps + apt-get install -q -y \ + libxkbfile-dev xfonts-utils xutils-dev + # X11 libraries deps + apt-get install -q -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 + apt-get install -q -y \ + quilt x11-xkb-utils + ;; + fedora*) + # basic packages + dnf -y install \ + autoconf automake gcc-c++ libtool make imake pkgconfig which + # imake deps + dnf -y install \ + xorg-x11-proto-devel zlib-devel + # X11 libraries deps + dnf -y install \ + libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \ + libX11-devel libXext-devel libXpm-devel libXfont2-devel \ + libXdmcp-devel libXdamage-devel libXcomposite-devel \ + libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ + xorg-x11-font-utils libtirpc-devel xkeyboard-config + # soft requirements + dnf -y install \ + quilt xorg-x11-xkb-utils-devel + ;; + centos:8) + # Enable powertools repository for imake + dnf -y install dnf-plugins-core epel-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 + dnf config-manager --set-enabled powertools + # basic packages + dnf -y install \ + autoconf automake gcc-c++ libtool make imake pkgconfig which + # imake deps + dnf -y install \ + xorg-x11-proto-devel zlib-devel + # X11 libraries deps + dnf -y install \ + libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \ + libX11-devel libXext-devel libXpm-devel libXfont2-devel \ + libXdmcp-devel libXdamage-devel libXcomposite-devel \ + libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ + xorg-x11-font-utils libtirpc-devel xkeyboard-config + # soft requirements + dnf --enablerepo="epel" -y install \ + quilt xorg-x11-xkb-utils-devel + ;; + centos:7) + # basic packages + yum -y install \ + autoconf automake gcc-c++ libtool make imake pkgconfig which + # imake deps + yum -y install \ + xorg-x11-proto-devel zlib-devel + # X11 libraries deps + yum -y install \ + libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \ + libX11-devel libXext-devel libXpm-devel libXfont-devel \ + libXdmcp-devel libXdamage-devel libXcomposite-devel \ + libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ + xorg-x11-font-utils libtirpc-devel xkeyboard-config + # soft requirements + yum -y install \ + quilt xorg-x11-xkb-utils-devel + ;; + esac + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build nx-libs with ${{ matrix.cfg.cc-version }} + shell: sh + env: + DEBIAN_FRONTEND: noninteractive + run: | + case "${{ matrix.cfg.cc-version }}" in + gcc) + export CC=gcc + export CXX=g++ + ;; + clang) + export CC=clang + export CXX=clang++ + ;; + esac + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + make + ;; + fedora*|centos*) + export IMAKE_DEFINES="-DUseTIRPC=YES" + make IMAKE_DEFINES="${IMAKE_DEFINES}" + ;; + esac -- cgit v1.2.3 From 637d6d733a96557c3c9aa345c23c9b233bb6710e Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 31 Jan 2021 10:29:14 +0100 Subject: Add shellcheck and cppcheck linters Signed-off-by: Mario Trangoni --- .github/workflows/linters.yml | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/linters.yml diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 000000000..936db9c8b --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,47 @@ +name: linters + +on: + push: + branches: [ 3.6.x ] + pull_request: + branches: [ 3.6.x ] + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + run: | + sudo apt-get update + sudo apt-get install shellcheck + + - name: run Shellcheck + run: | + find . -name "*.sh" | xargs shellcheck || true + + cppcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + run: | + sudo apt-get update + sudo apt-get install cppcheck + + - name: run cppcheck + run: | + # cppcheck + if ! [ -x "$(command -v cppcheck)" ]; then + echo 'Error: cppcheck is not installed.' >&2 + exit 1 + fi + CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions' + # we exclude some external projects + 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 .; -- cgit v1.2.3 From 1620c93f0a509f82abf636872dcfd0360b88d97c Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 31 Jan 2021 10:40:17 +0100 Subject: Replace TravisCI with GitHub Actions Signed-off-by: Mario Trangoni --- .travis.yml | 172 ------------------------------------------------- README.md | 2 +- run-static-analysis.sh | 14 ---- 3 files changed, 1 insertion(+), 187 deletions(-) delete mode 100644 .travis.yml delete mode 100755 run-static-analysis.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 776c1a4bd..000000000 --- a/.travis.yml +++ /dev/null @@ -1,172 +0,0 @@ -# Use new bionic images, should yield newer compilers and packages -language: cpp -os: linux -dist: xenial - -jobs: - include: - - name: "GCC 5.4" - addons: - apt: - update: true - sources: - - ubuntu-toolchain-r-test - packages: - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=gcc && CXX=g++" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="no" - - - name: "cppcheck 1.82 + GCC 10.x" - dist: bionic - addons: - apt: - update: true - sources: - - ubuntu-toolchain-r-test - packages: - - cppcheck - - g++-10 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - - STATIC_ANALYSIS="yes" - - PVS_ANALYZE="no" - - - name: "GCC 10.x + PVS-Studio" - dist: bionic - addons: - apt: - update: true - sources: - - ubuntu-toolchain-r-test - packages: - - g++-10 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="yes" - - - name: "Clang 3.9" - addons: - apt: - update: true - sources: - - llvm-toolchain-xenial-3.9 - packages: - - clang-3.9 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="no" - - - name: "Clang 9.x" - dist: bionic - addons: - apt: - update: true - sources: - - llvm-toolchain-bionic-9 - - ubuntu-toolchain-r-test - packages: - - clang-9 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="no" - -before_install: - - eval "${MATRIX_EVAL}" - - travis_retry bash .pvs-studio.sh before_install - -script: - # run static analysis tools - - ./run-static-analysis.sh - # print compiler version - - ${CC} --version - # build all packages - - travis_retry bash .pvs-studio.sh build_script diff --git a/README.md b/README.md index d781194b4..8470199f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NX development by ArticaProject, X2Go and TheQVD [![Build Status](https://travis-ci.org/ArcticaProject/nx-libs.svg)](https://travis-ci.org/ArcticaProject/nx-libs) +# NX development by ArticaProject, X2Go and TheQVD This source tree started as a re-distribution of those NX packages needed to setup FreeNX and/or X2Go on a Linux server. diff --git a/run-static-analysis.sh b/run-static-analysis.sh deleted file mode 100755 index a9368973b..000000000 --- a/run-static-analysis.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then - # cppcheck - if ! [ -x "$(command -v cppcheck)" ]; then - echo 'Error: cppcheck is not installed.' >&2 - exit 1 - fi - CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions' - # we exclude some external projects - 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 .; -fi -- cgit v1.2.3 From 3da6e9c3a348cc3ffe20701e389fd2046d0d4e1d Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 31 Jan 2021 11:07:07 +0100 Subject: Move PVS run to GitHub Actions Signed-off-by: Mario Trangoni --- .github/workflows/linters.yml | 62 ++++++++++++++++++++++++++++++++++++++++--- .github/workflows/nx-libs.yml | 2 +- .pvs-studio.sh | 37 -------------------------- 3 files changed, 59 insertions(+), 42 deletions(-) delete mode 100644 .pvs-studio.sh 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@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@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@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; -- cgit v1.2.3 From 3dfd7a711567f90878acb1a58ee5fe3228f102b9 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sat, 6 Feb 2021 18:09:21 +0100 Subject: linters: Enable shellcheck This will be green after #1001 get merged. Signed-off-by: Mario Trangoni --- .github/workflows/linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 183924dfd..c6a238fd2 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -20,7 +20,7 @@ jobs: - name: run Shellcheck run: | - find . -name "*.sh" | xargs shellcheck || true + find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086 cppcheck: runs-on: ubuntu-20.04 -- cgit v1.2.3 From 899c2a6f112610b8cdb2566f85fc533ff5e81885 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sat, 6 Feb 2021 18:43:49 +0100 Subject: Build nx-libs on different architectures Signed-off-by: Mario Trangoni --- .github/workflows/nx-libs-archs.yml | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/nx-libs-archs.yml diff --git a/.github/workflows/nx-libs-archs.yml b/.github/workflows/nx-libs-archs.yml new file mode 100644 index 000000000..b2e343acd --- /dev/null +++ b/.github/workflows/nx-libs-archs.yml @@ -0,0 +1,81 @@ +name: nx-libs CI diff archs + +on: + push: + branches: [ 3.6.x ] + pull_request: + branches: [ 3.6.x ] + +jobs: + build: + runs-on: ubuntu-20.04 + name: Build on ${{ matrix.distro }} ${{ matrix.arch }} with gcc + + # Run steps on a matrix of 4 arch/distro combinations + strategy: + fail-fast: false + matrix: + include: + - arch: aarch64 + distro: ubuntu20.04 + - arch: ppc64le + distro: ubuntu20.04 + - arch: s390x + distro: ubuntu20.04 + - arch: armv7 + distro: ubuntu20.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - uses: uraimo/run-on-arch-action@v2.0.8 + name: Build artifact + id: build + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + + # Not required, but speeds up builds + githubToken: ${{ github.token }} + + # Pass some environment variables to the container + env: | + CC: gcc + CXX: g++ + DEBIAN_FRONTEND: noninteractive + + # The shell to run commands with in the container + shell: /bin/sh + + # Install some dependencies in the container. This speeds up builds if + # you are also using githubToken. Any dependencies installed here will + # be part of the container image that gets cached, so subsequent + # builds don't have to re-install them. The image layer is cached + # publicly in your project's package repository, so it is vital that + # no secrets are present in the container state or logs. + install: | + case "${{ matrix.distro }}" in + ubuntu*) + cat /etc/debian_version + apt-get update -q -y + apt-get install -q -y gcc g++ + gcc --version + # basic packages + apt-get install -q -y \ + autoconf libtool make pkg-config + # imake deps + apt-get install -q -y \ + libxkbfile-dev xfonts-utils xutils-dev + # X11 libraries deps + apt-get install -q -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 + apt-get install -q -y \ + quilt x11-xkb-utils + ;; + esac + + run: | + make -- cgit v1.2.3 From d570730e6d6bbc52382cc2f1029996d4a3f8041d Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 7 Feb 2021 11:19:52 +0100 Subject: Fix missing quilt on CentOS7 Signed-off-by: Mario Trangoni --- .github/workflows/nx-libs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index 5988f05c6..28a7bd237 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -133,7 +133,9 @@ jobs: quilt xorg-x11-xkb-utils-devel ;; centos:7) - # basic packages + # enable epel repository for quilt + yum -y install epel-release + # basic packages yum -y install \ autoconf automake gcc-c++ libtool make imake pkgconfig which # imake deps @@ -147,7 +149,7 @@ jobs: libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ xorg-x11-font-utils libtirpc-devel xkeyboard-config # soft requirements - yum -y install \ + yum -y --enablerepo=epel install \ quilt xorg-x11-xkb-utils-devel ;; esac -- cgit v1.2.3 From 077089c4e4f7fcdff55d316811482c920cb62c7f Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 7 Feb 2021 11:20:20 +0100 Subject: Add linter references Signed-off-by: Mario Trangoni --- .github/workflows/linters.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index c6a238fd2..6bad1fd15 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -7,6 +7,7 @@ on: branches: [ 3.6.x ] jobs: + # see https://github.com/koalaman/shellcheck shellcheck: runs-on: ubuntu-20.04 steps: @@ -22,6 +23,7 @@ jobs: run: | find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086 + # see https://github.com/danmar/cppcheck cppcheck: runs-on: ubuntu-20.04 steps: @@ -45,6 +47,8 @@ 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 .; + + # see https://www.viva64.com/en/pvs-studio/ pvs: environment: pvs runs-on: ubuntu-20.04 -- cgit v1.2.3 From b42544cf4c8e14d3a070a12695fcc3bb5d867def Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 7 Feb 2021 13:38:15 +0100 Subject: Install build-essentials on clang Signed-off-by: Mario Trangoni --- .github/workflows/nx-libs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index 28a7bd237..fe5523166 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -46,6 +46,8 @@ jobs: gcc) apt-get install -q -y g++ ;; + clang) + apt-get install -q -y build-essential esac ;; fedora*) @@ -135,6 +137,7 @@ jobs: centos:7) # enable epel repository for quilt yum -y install epel-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 # basic packages yum -y install \ autoconf automake gcc-c++ libtool make imake pkgconfig which -- cgit v1.2.3 From 69864ad11cf05198a673e4507d6006b21a243a31 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 7 Feb 2021 14:19:52 +0100 Subject: Add pylint to GitHub Actions Signed-off-by: Mario Trangoni --- .github/workflows/linters.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 6bad1fd15..f8a670610 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -21,8 +21,29 @@ jobs: - name: run Shellcheck run: | + shellcheck --version find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086 + # see https://pylint.org/ + pylint: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + run: | + sudo apt-get update -q -y + sudo apt-get install pylint + # dependencies + sudo apt-get install --reinstall python-gi + sudo apt-get install python-dbus python-gobject + + - name: run Pylint + run: | + pylint --version + cd nxdialog/; find . -name "nxdialog" -type f | xargs pylint --exit-zero + # see https://github.com/danmar/cppcheck cppcheck: runs-on: ubuntu-20.04 -- cgit v1.2.3