Skip to content

Commit f4d654e

Browse files
committed
Merge branch 'test-github-actions' into 3.6.x
Attributes GH PR ArcticaProject#974: ArcticaProject#974
2 parents 0e2b797 + 69864ad commit f4d654e

7 files changed

+394
-224
lines changed

.github/workflows/linters.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: linters
2+
3+
on:
4+
push:
5+
branches: [ 3.6.x ]
6+
pull_request:
7+
branches: [ 3.6.x ]
8+
9+
jobs:
10+
# see https://github.com/koalaman/shellcheck
11+
shellcheck:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Install linters on ubuntu
18+
run: |
19+
sudo apt-get update -q -y
20+
sudo apt-get install shellcheck
21+
22+
- name: run Shellcheck
23+
run: |
24+
shellcheck --version
25+
find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086
26+
27+
# see https://pylint.org/
28+
pylint:
29+
runs-on: ubuntu-20.04
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v2
33+
34+
- name: Install linters on ubuntu
35+
run: |
36+
sudo apt-get update -q -y
37+
sudo apt-get install pylint
38+
# dependencies
39+
sudo apt-get install --reinstall python-gi
40+
sudo apt-get install python-dbus python-gobject
41+
42+
- name: run Pylint
43+
run: |
44+
pylint --version
45+
cd nxdialog/; find . -name "nxdialog" -type f | xargs pylint --exit-zero
46+
47+
# see https://github.com/danmar/cppcheck
48+
cppcheck:
49+
runs-on: ubuntu-20.04
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v2
53+
54+
- name: Install linters on ubuntu
55+
run: |
56+
sudo apt-get update -q -y
57+
sudo apt-get install cppcheck
58+
59+
- name: run cppcheck
60+
run: |
61+
# cppcheck
62+
if ! [ -x "$(command -v cppcheck)" ]; then
63+
echo 'Error: cppcheck is not installed.' >&2
64+
exit 1
65+
fi
66+
CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions'
67+
# we exclude some external projects
68+
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'
69+
echo "$(cppcheck --version):";
70+
cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .;
71+
72+
# see https://www.viva64.com/en/pvs-studio/
73+
pvs:
74+
environment: pvs
75+
runs-on: ubuntu-20.04
76+
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@v2
79+
80+
- name: Install linters on ubuntu
81+
env:
82+
DEBIAN_FRONTEND: noninteractive
83+
run: |
84+
sudo apt-get update -qq -y
85+
# compiler
86+
sudo apt-get install -qq -y gcc g++
87+
# basic packages
88+
sudo apt-get install -qq -y \
89+
autoconf libtool make pkg-config
90+
# imake deps
91+
sudo apt-get install -qq -y \
92+
libxkbfile-dev xfonts-utils xutils-dev
93+
# X11 libraries deps
94+
sudo apt-get install -qq -y \
95+
libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \
96+
libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \
97+
libxtst-dev x11proto-fonts-dev
98+
# soft requirements
99+
sudo apt-get install -qq -y \
100+
quilt x11-xkb-utils
101+
# PVS
102+
sudo wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add -
103+
sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
104+
sudo apt-get update -qq
105+
sudo apt-get install -qq pvs-studio
106+
107+
- name: Run PVS-Studio Analyzer
108+
shell: bash
109+
env:
110+
PVS_USERNAME: ${{ secrets.PVS_USERNAME }}
111+
PVS_KEY: ${{ secrets.PVS_KEY }}
112+
run: |
113+
# check environment variables
114+
if [[ -z "${PVS_USERNAME}" ]]; then
115+
echo '"PVS_USERNAME" environment variable not set'
116+
exit 0
117+
elif [[ -z "${PVS_KEY}" ]]; then
118+
echo '"PVS_KEY" environment variable not set'
119+
exit 0
120+
else
121+
pvs-studio-analyzer credentials -o "PVS-Studio.lic" "${PVS_USERNAME}" "${PVS_KEY}"
122+
pvs-studio-analyzer trace -- make
123+
pvs-studio-analyzer analyze --quiet --lic-file "PVS-Studio.lic" --output-file "PVS-Studio-${CC}.log"
124+
plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log"
125+
cat "PVS-Studio-${CC}.tasks"
126+
fi

.github/workflows/nx-libs-archs.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: nx-libs CI diff archs
2+
3+
on:
4+
push:
5+
branches: [ 3.6.x ]
6+
pull_request:
7+
branches: [ 3.6.x ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
name: Build on ${{ matrix.distro }} ${{ matrix.arch }} with gcc
13+
14+
# Run steps on a matrix of 4 arch/distro combinations
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- arch: aarch64
20+
distro: ubuntu20.04
21+
- arch: ppc64le
22+
distro: ubuntu20.04
23+
- arch: s390x
24+
distro: ubuntu20.04
25+
- arch: armv7
26+
distro: ubuntu20.04
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v2
31+
- uses: uraimo/run-on-arch-action@v2.0.8
32+
name: Build artifact
33+
id: build
34+
with:
35+
arch: ${{ matrix.arch }}
36+
distro: ${{ matrix.distro }}
37+
38+
# Not required, but speeds up builds
39+
githubToken: ${{ github.token }}
40+
41+
# Pass some environment variables to the container
42+
env: |
43+
CC: gcc
44+
CXX: g++
45+
DEBIAN_FRONTEND: noninteractive
46+
47+
# The shell to run commands with in the container
48+
shell: /bin/sh
49+
50+
# Install some dependencies in the container. This speeds up builds if
51+
# you are also using githubToken. Any dependencies installed here will
52+
# be part of the container image that gets cached, so subsequent
53+
# builds don't have to re-install them. The image layer is cached
54+
# publicly in your project's package repository, so it is vital that
55+
# no secrets are present in the container state or logs.
56+
install: |
57+
case "${{ matrix.distro }}" in
58+
ubuntu*)
59+
cat /etc/debian_version
60+
apt-get update -q -y
61+
apt-get install -q -y gcc g++
62+
gcc --version
63+
# basic packages
64+
apt-get install -q -y \
65+
autoconf libtool make pkg-config
66+
# imake deps
67+
apt-get install -q -y \
68+
libxkbfile-dev xfonts-utils xutils-dev
69+
# X11 libraries deps
70+
apt-get install -q -y \
71+
libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \
72+
libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \
73+
libxtst-dev x11proto-fonts-dev
74+
# soft requirements
75+
apt-get install -q -y \
76+
quilt x11-xkb-utils
77+
;;
78+
esac
79+
80+
run: |
81+
make

.github/workflows/nx-libs.yml

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
name: nx-libs CI
2+
3+
on:
4+
push:
5+
branches: [ 3.6.x ]
6+
pull_request:
7+
branches: [ 3.6.x ]
8+
9+
jobs:
10+
build:
11+
name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cc-version }}
12+
runs-on: ubuntu-20.04
13+
container: ${{ matrix.cfg.container }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
cfg:
18+
- { container: 'ubuntu:16.04', cc-version: gcc }
19+
- { container: 'ubuntu:16.04', cc-version: clang }
20+
- { container: 'ubuntu:20.04', cc-version: gcc }
21+
- { container: 'ubuntu:20.04', cc-version: clang }
22+
- { container: 'debian:stable', cc-version: gcc }
23+
- { container: 'debian:stable', cc-version: clang }
24+
- { container: 'debian:sid', cc-version: gcc }
25+
- { container: 'debian:sid', cc-version: clang }
26+
- { container: 'centos:7', cc-version: gcc }
27+
- { container: 'centos:7', cc-version: clang }
28+
- { container: 'centos:8', cc-version: gcc }
29+
- { container: 'centos:8', cc-version: clang }
30+
- { container: 'fedora:latest', cc-version: gcc }
31+
- { container: 'fedora:latest', cc-version: clang }
32+
33+
steps:
34+
- name: Install compiler ${{ matrix.cfg.cc-version }}
35+
shell: sh
36+
env:
37+
DEBIAN_FRONTEND: noninteractive
38+
run: |
39+
case "${{ matrix.cfg.container }}" in
40+
ubuntu*|debian*)
41+
cat /etc/debian_version
42+
apt-get update -q -y
43+
apt-get install -q -y ${{ matrix.cfg.cc-version }}
44+
${{ matrix.cfg.cc-version }} --version
45+
case "${{ matrix.cfg.cc-version }}" in
46+
gcc)
47+
apt-get install -q -y g++
48+
;;
49+
clang)
50+
apt-get install -q -y build-essential
51+
esac
52+
;;
53+
fedora*)
54+
cat /etc/fedora-release
55+
dnf -y update
56+
dnf -y install ${{ matrix.cfg.cc-version }}
57+
${{ matrix.cfg.cc-version }} --version
58+
;;
59+
centos:8)
60+
cat /etc/centos-release
61+
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
62+
dnf -y update
63+
dnf -y install ${{ matrix.cfg.cc-version }}
64+
${{ matrix.cfg.cc-version }} --version
65+
;;
66+
centos:7)
67+
cat /etc/centos-release
68+
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
69+
yum -y update
70+
yum -y install ${{ matrix.cfg.cc-version }}
71+
${{ matrix.cfg.cc-version }} --version
72+
;;
73+
esac
74+
75+
- name: Install nx-libs dependencies ${{ matrix.cfg.cc-version }}
76+
shell: sh
77+
env:
78+
DEBIAN_FRONTEND: noninteractive
79+
run: |
80+
case "${{ matrix.cfg.container }}" in
81+
ubuntu*|debian*)
82+
# basic packages
83+
apt-get install -q -y \
84+
autoconf libtool make pkg-config
85+
# imake deps
86+
apt-get install -q -y \
87+
libxkbfile-dev xfonts-utils xutils-dev
88+
# X11 libraries deps
89+
apt-get install -q -y \
90+
libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \
91+
libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \
92+
libxtst-dev x11proto-fonts-dev
93+
# soft requirements
94+
apt-get install -q -y \
95+
quilt x11-xkb-utils
96+
;;
97+
fedora*)
98+
# basic packages
99+
dnf -y install \
100+
autoconf automake gcc-c++ libtool make imake pkgconfig which
101+
# imake deps
102+
dnf -y install \
103+
xorg-x11-proto-devel zlib-devel
104+
# X11 libraries deps
105+
dnf -y install \
106+
libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \
107+
libX11-devel libXext-devel libXpm-devel libXfont2-devel \
108+
libXdmcp-devel libXdamage-devel libXcomposite-devel \
109+
libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \
110+
xorg-x11-font-utils libtirpc-devel xkeyboard-config
111+
# soft requirements
112+
dnf -y install \
113+
quilt xorg-x11-xkb-utils-devel
114+
;;
115+
centos:8)
116+
# Enable powertools repository for imake
117+
dnf -y install dnf-plugins-core epel-release
118+
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
119+
dnf config-manager --set-enabled powertools
120+
# basic packages
121+
dnf -y install \
122+
autoconf automake gcc-c++ libtool make imake pkgconfig which
123+
# imake deps
124+
dnf -y install \
125+
xorg-x11-proto-devel zlib-devel
126+
# X11 libraries deps
127+
dnf -y install \
128+
libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \
129+
libX11-devel libXext-devel libXpm-devel libXfont2-devel \
130+
libXdmcp-devel libXdamage-devel libXcomposite-devel \
131+
libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \
132+
xorg-x11-font-utils libtirpc-devel xkeyboard-config
133+
# soft requirements
134+
dnf --enablerepo="epel" -y install \
135+
quilt xorg-x11-xkb-utils-devel
136+
;;
137+
centos:7)
138+
# enable epel repository for quilt
139+
yum -y install epel-release
140+
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
141+
# basic packages
142+
yum -y install \
143+
autoconf automake gcc-c++ libtool make imake pkgconfig which
144+
# imake deps
145+
yum -y install \
146+
xorg-x11-proto-devel zlib-devel
147+
# X11 libraries deps
148+
yum -y install \
149+
libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \
150+
libX11-devel libXext-devel libXpm-devel libXfont-devel \
151+
libXdmcp-devel libXdamage-devel libXcomposite-devel \
152+
libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \
153+
xorg-x11-font-utils libtirpc-devel xkeyboard-config
154+
# soft requirements
155+
yum -y --enablerepo=epel install \
156+
quilt xorg-x11-xkb-utils-devel
157+
;;
158+
esac
159+
160+
- name: Checkout repository
161+
uses: actions/checkout@v2
162+
163+
- name: Build nx-libs with ${{ matrix.cfg.cc-version }}
164+
shell: sh
165+
env:
166+
DEBIAN_FRONTEND: noninteractive
167+
run: |
168+
case "${{ matrix.cfg.cc-version }}" in
169+
gcc)
170+
export CC=gcc
171+
export CXX=g++
172+
;;
173+
clang)
174+
export CC=clang
175+
export CXX=clang++
176+
;;
177+
esac
178+
case "${{ matrix.cfg.container }}" in
179+
ubuntu*|debian*)
180+
make
181+
;;
182+
fedora*|centos*)
183+
export IMAKE_DEFINES="-DUseTIRPC=YES"
184+
make IMAKE_DEFINES="${IMAKE_DEFINES}"
185+
;;
186+
esac

0 commit comments

Comments
 (0)