Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/archlinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/bash

# Use grouped output messages
infobegin() {
echo "::group::${1}"
}
infoend() {
echo "::endgroup::"
}

# Required packages on Archlinux
requires=(
ccache # Use ccache to speed up build
clang # Build with clang on Archlinux
meson # Used for meson build
)

# https://gitlab.archlinux.org/archlinux/packaging/packages/mate-calc
requires+=(
autoconf-archive
gcc
gettext
git
glib2-devel
gtk3
intltool
itstool
libmpc
make
mate-common
which
yelp-tools
)

infobegin "Update system"
pacman --noconfirm -Syu
infoend

infobegin "Install dependency packages"
pacman --noconfirm -S ${requires[@]}
infoend
163 changes: 0 additions & 163 deletions .github/workflows/build.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/builds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/bash

set -e
set -o pipefail

CPUS=$(grep processor /proc/cpuinfo | wc -l)

# Use grouped output messages
infobegin() {
echo "::group::${1}"
}
infoend() {
echo "::endgroup::"
}

# Run meson first, then run autotools
# Because meson dist requires a clean git workspace
# Autotools will modify some files (such as po, etc.), making them dirty.
if [ -f meson.build ]; then

infobegin "Configure (meson)"
meson setup _build --prefix=/usr
infoend

infobegin "Build (meson)"
meson compile -C _build
infoend

infobegin "Test (meson)"
ninja -C _build test
infoend

infobegin "Dist (meson)"
# Git safedirectory stop ninja dist
# https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9
# https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
git config --global --add safe.directory ${PWD}
ninja -C _build dist
infoend
fi

if [ -f autogen.sh ]; then
infobegin "Configure (autotools)"
NOCONFIGURE=1 ./autogen.sh
./configure --prefix=/usr --enable-compile-warnings=maximum || {
cat config.log
exit 1
}
infoend

infobegin "Build (autotools)"
make -j ${CPUS}
infoend

infobegin "Check (autotools)"
make -j ${CPUS} check || {
true
}
infoend

infobegin "Distcheck (autotools)"
make -j ${CPUS} distcheck
infoend
fi
75 changes: 75 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
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.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.sha }}
cancel-in-progress: true


jobs:
build:
name: Build on ${{matrix.container}} (using ${{matrix.cc}})
runs-on: ubuntu-latest
container:
image: ${{matrix.container}}

strategy:
fail-fast: false # don't cancel other jobs in the matrix if one fails
matrix:
container:
[
"debian:testing",
"fedora:latest",
"ubuntu:rolling",
"archlinux:latest",
]
cc: ["gcc"]
cxx: ["g++"]
include:
- container: "archlinux:latest"
cc: "clang"
cxx: "clang++"

env:
# Speed up build with ccache
CC: ccache ${{ matrix.cc }}
CXX: ccache ${{ matrix.cxx }}
CONTAINER: ${{ matrix.container }}

steps:
- name: Setup environment variables
id: distro-name
shell: bash
run: |
split=(${CONTAINER//:/ })
distro=${split[0]}
short_sha=${SHA:0:8}
echo "DISTRO=$distro" | tee -a $GITHUB_ENV
- name: Install git command
shell: bash
run: |
echo "::group::Install git ..."
apt-get update -qq && apt-get install --assume-yes git || true
dnf update -y && dnf install -y git || true
pacman --noconfirm -Sy git || true
echo "::endgroup::"
- name: Repository checkout
uses: actions/checkout@v5
- name: Install dependency packages
run: .github/workflows/${{ env.DISTRO }}.sh
- name: Enable ccache to speed up builds
uses: hendrikmuhs/[email protected]
with:
key: ${{ env.DISTRO }}-${{ matrix.cc }}

- name: Build the source code
run: .github/workflows/builds.sh
42 changes: 42 additions & 0 deletions .github/workflows/debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/bash

# Use grouped output messages
infobegin() {
echo "::group::${1}"
}
infoend() {
echo "::endgroup::"
}

# Required packages on Debian
requires=(
ccache # Use ccache to speed up build
meson # Used for meson build
)

# https://salsa.debian.org/debian-mate-team/mate-calc
requires+=(
autopoint
bison
flex
libatk1.0-dev
libglib2.0-dev
libgmp-dev
libgtk-3-dev
libmpc-dev
libmpfr-dev
libxml2-dev
make
mate-common
yelp-tools
)

infobegin "Update system"
apt-get update -qq
infoend

infobegin "Install dependency packages"
env DEBIAN_FRONTEND=noninteractive \
apt-get install --assume-yes \
${requires[@]}
infoend
Loading