Skip to content

WIP: Enable a github actions build #39

WIP: Enable a github actions build

WIP: Enable a github actions build #39

Workflow file for this run

name: CI Build
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
# cancel already running builds of the same branch or pull request
concurrency:
group: ci-${{ github.head_ref }} || concat(${{ github.ref }}
cancel-in-progress: true
env:
MATE_PANEL_DEP: 1.27.1
CONFIGURE_FLAGS: --enable-compile-warnings=maximum
CFLAGS: -g -O2 -Werror=pointer-arith -Werror=implicit-function-declaration
JOBS: 2
DEBUG: 1
# Useful URL: https://github.com/mate-desktop/debian-packages
# Useful URL: https://salsa.debian.org/debian-mate-team/mate-panel
DEB_LIBRARY_DEPS: |
libatk1.0-dev
libcairo2-dev
libdconf-dev
libgirepository1.0-dev
libglib2.0-dev
libgtk-3-dev
libgtk-layer-shell-dev
libice-dev
libmate-desktop-dev
libmate-menu-dev
libmateweather-dev
libpango1.0-dev
libsm-dev
libsoup2.4-dev
libwnck-3-dev
libx11-dev
libxrandr-dev
libgirepository1.0-dev
DEB_BUILD_DEPS: |
ccache
autoconf-archive
autopoint
gir1.2-freedesktop
git
gobject-introspection
gtk-doc-tools
lsb-release
make
mate-common
meson
yelp-tools
iso-codes
gobject-introspection
# TODO
DEB_SCAN_BUILD_DEPS: |
clang
clang-tools
# Useful URL: https://git.archlinux.org/svntogit/community.git/tree/mate-panel
# + mate-desktop dependencies
ARCH_BUILD_DEPS: |
ccache
autoconf-archive
clang
gcc
git
gobject-introspection
gtk-layer-shell
itstool
libcanberra
libmateweather
libsm
libwnck3
make
mate-common
mate-desktop
mate-menus
meson
which
yelp-tools
iso-codes
gobject-introspection
jobs:
build:
name: Build on ${{matrix.container}} with in-process=${{matrix.in-process}}
runs-on: ubuntu-latest
container: ${{matrix.container}}
strategy:
fail-fast: false
matrix:
in-process: [all, none]
container: ['debian:testing', 'ubuntu:rolling', 'archlinux:latest']
env:
CC: ccache gcc
CXX: ccache g++
MATE_DESKTOP_INSTALL_PATH: ${{github.workspace}}/mate-desktop-install
steps:
- name: Setup environment
run: |
echo "PATH=${MATE_DESKTOP_INSTALL_PATH}/bin:${PATH}" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=${MATE_DESKTOP_INSTALL_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}" >> "$GITHUB_ENV"
- name: Show environment
run: env | sort
if: ${{ env.DEBUG == '1' }}
# For Debian and Ubuntu (apt-based with reasonably compatible packages)
- name: Install dependencies
if: ${{ startsWith(matrix.container, 'debian:') || startsWith(matrix.container, 'ubuntu:') }}
run: |
apt-get update -qq
apt-get install --assume-yes --no-install-recommends \
${DEB_BUILD_DEPS} ${DEB_LIBRARY_DEPS}
# For ArchLinux
- name: Install dependencies
if: ${{ startsWith(matrix.container, 'archlinux:') }}
# don't upgrade, although told otherwise (see link below), because
# apparently in the container it doesn't quit work...
# https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported
run: |
pacman --noconfirm -Sy
pacman --noconfirm -S ${ARCH_BUILD_DEPS}
- uses: actions/checkout@v3
with:
path: mate-panel
submodules: true
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Cache mate-desktop dependency
uses: actions/cache@v3
id: cache-mate-desktop
with:
path: ${{env.MATE_DESKTOP_INSTALL_PATH}}
key: ${{runner.os}}-${{runner.arch}}-${{matrix.container}}-build-mate-desktop-${{env.MATE_PANEL_DEP}}
- name: Checkout mate-desktop
uses: actions/checkout@v3
if: ${{ steps.cache-mate-desktop.outputs.cache-hit != 'true' }}
with:
repository: mate-desktop/mate-desktop
ref: v${{env.MATE_PANEL_DEP}}
path: mate-desktop
submodules: true
- name: Install mate-desktop v${{env.MATE_PANEL_DEP}}
if: ${{ steps.cache-mate-desktop.outputs.cache-hit != 'true' }}
run: |
cd mate-desktop
NOCONFIGURE=1 ./autogen.sh
{ ./configure --prefix="${MATE_DESKTOP_INSTALL_PATH}" || { cat config.log; exit 1; } ; }
make -j ${{ env.JOBS }}
make -j ${{ env.JOBS }} install
- name: Configure
run: |
cd mate-panel
NOCONFIGURE=1 ./autogen.sh
{ ./configure ${CONFIGURE_FLAGS} --with-in-process-applets=${{matrix.in-process}} || { cat config.log; exit 1; } ; }
- name: Build
run: make -C mate-panel -j ${{ env.JOBS }}
- name: Run Tests
run: make -C mate-panel -j ${{ env.JOBS }} check
- name: Run distcheck
if: ${{ startsWith(matrix.container, 'debian:') }}
run: make -C mate-panel -j ${{ env.JOBS }} distcheck
# Do we need the real build for cppcheck run? I don't think so
cppcheck:
name: Run cppcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
# Install code dependencies so that cppcheck has more info
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install --assume-yes --no-install-recommends \
cppcheck ${DEB_LIBRARY_DEPS}
- name: cppcheck
run: cppcheck --enable=warning,style,performance,portability,information,missingInclude -i'gtk-layer-shell-build' .