Ticket #4170: implement CI via GitHub Actions

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Yury V. Zaytsev 2024-06-01 18:02:06 +02:00
parent 4bd73a7de0
commit 319507c595
7 changed files with 378 additions and 0 deletions

46
.github/workflows/ci-alpine.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: ci-alpine
on:
workflow_call:
jobs:
build-alpine:
runs-on: ubuntu-latest
container:
image: alpine:latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
apk add autoconf automake build-base libtool pkgconf sudo
apk add aspell-dev check-dev e2fsprogs-dev gettext-dev glib-dev gpm-dev libssh2-dev perl slang-dev
- name: Bootstrap build system
run: ./autogen.sh
- name: Build default configuration
run: |
adduser --home "$(pwd)" --no-create-home --disabled-password test
chown -R test "$(pwd)"
su - test -c ' \
./configure \
--prefix="$(pwd)/install-prefix" \
--enable-mclib \
--enable-aspell \
--enable-werror \
&& \
\
make -j$(nproc) && \
make check && \
make install \
'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-suite-logs-alpine
path: ./**/test-suite.log

49
.github/workflows/ci-fedora.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: ci-fedora
on:
workflow_call:
jobs:
build-fedora:
runs-on: ubuntu-latest
container:
image: fedora:latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
dnf install -y autoconf automake gcc gettext-devel libtool make pkgconfig
dnf install -y aspell-devel check-devel gpm-devel libX11-devel "pkgconfig(ext2fs)" "pkgconfig(glib-2.0)" "pkgconfig(gmodule-2.0)" "pkgconfig(libssh2)" "pkgconfig(slang)"
# For tests
dnf install -y glibc-gconv-extra util-linux
- name: Bootstrap build system
run: ./autogen.sh
- name: Build default configuration
run: |
useradd --home "$(pwd)" test
chown -R test "$(pwd)"
su - test -c ' \
./configure \
--prefix="$(pwd)/install-prefix" \
--enable-mclib \
--enable-aspell \
--enable-werror \
&& \
\
make -j$(nproc) && \
make check && \
make install \
'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-suite-logs-fedora
path: ./**/test-suite.log

54
.github/workflows/ci-freebsd.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: ci-freebsd
on:
workflow_call:
inputs:
CFLAGS:
description: 'Custom CFLAGS'
default: ''
required: false
type: string
jobs:
build-freebsd:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Build on FreeBSD
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y autoconf automake gettext libtool pkgconf
pkg install -y aspell check glib libssh2 libX11
run: |
./autogen.sh
pw useradd test -d "$(pwd)"
chown -R test $(pwd)
su - test -c ' \
\
export CFLAGS="${{ inputs.CFLAGS }}" && \
\
./configure \
--prefix="$(pwd)/install-prefix" \
--with-screen=ncurses \
--enable-mclib \
--enable-aspell \
--enable-werror \
&& \
\
make && \
make check && \
make install \
'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-suite-logs-freebsd
path: ./**/test-suite.log

47
.github/workflows/ci-macos.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: ci-macos
on:
workflow_call:
inputs:
CFLAGS:
description: 'Custom CFLAGS'
default: ''
required: false
type: string
jobs:
build-macos:
runs-on: macos-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install autoconf automake gettext check gnu-indent libtool pkg-config
brew install aspell e2fsprogs glib libssh2 openssl s-lang
# unzip is part of the base system
- name: Bootstrap build system
run: ./autogen.sh
- name: Build default configuration
run: |
export CFLAGS="${{ inputs.CFLAGS }}"
./configure \
--prefix="$(pwd)/install-prefix" \
--enable-mclib \
--enable-aspell=/opt/homebrew
make -j$(sysctl -n hw.logicalcpu)
make check
make install
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-suite-logs-macos
path: ./**/test-suite.log

48
.github/workflows/ci-solaris.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: ci-solaris
on:
workflow_call:
jobs:
build-solaris:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Build on Solaris
uses: vmactions/solaris-vm@v1
with:
release: "11.4-gcc" # autoconf automake developer/gcc/gcc-c libtool pkg-config
prepare: |
pkg install --no-backup-be --no-refresh --accept -v \
aspell check glib2 libssh2 libx11
run: |
./autogen.sh
useradd -d "$(pwd)" test
chown -R test $(pwd)
su - test -c ' \
export PKG_CONFIG_PATH=/usr/lib/64/pkgconfig && \
\
./configure \
--prefix="$(pwd)/install-prefix" \
--with-screen=ncurses \
--enable-mclib \
--enable-aspell \
--enable-werror \
&& \
\
make && \
make check && \
make install \
'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-suite-logs-solaris
path: ./**/test-suite.log

100
.github/workflows/ci-ubuntu.yml vendored Normal file
View File

@ -0,0 +1,100 @@
name: ci-ubuntu
on:
workflow_call:
jobs:
build-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get install -y autoconf autopoint check gettext indent libtool pkg-config
sudo apt-get install -y e2fslibs-dev libaspell-dev libglib2.0-dev libgpm-dev libncurses5-dev libpcre2-dev libslang2-dev libssh2-1-dev libx11-dev unzip
- name: Bootstrap build system
run: ./autogen.sh
- name: Build distribution archive
run: |
mkdir -p build-distrib && cd $_
../configure
make dist-bzip2
- name: Build full configuration
run: |
tar -xjf $(ls build-distrib/mc-*.tar.bz2) --one-top-level=build-full
cd build-full
../configure \
--prefix="$(pwd)/install" \
--enable-mclib \
--enable-aspell \
--enable-vfs-undelfs \
--enable-werror
make indent
# TODO: exit 1
git ls-files --modified
make -j$(nproc)
make check
make install
- name: Build ncurses & pcre2 configuration
run: |
tar -xjf $(ls build-distrib/mc-*.tar.bz2) --one-top-level=build-ncurses
cd build-ncurses
../configure \
--prefix="$(pwd)/install" \
--with-screen=ncurses \
--with-search-engine=pcre2 \
--enable-werror
make -j$(nproc)
make check
- name: Build minimal configuration
run: |
tar -xjf $(ls build-distrib/mc-*.tar.bz2) --one-top-level=build-minimal
cd build-minimal
../configure \
--prefix="$(pwd)/install" \
--disable-shared \
--disable-static \
--disable-maintainer-mode \
--disable-largefile \
--disable-nls \
--disable-rpath \
--disable-charset \
--disable-mclib \
--disable-assert \
--disable-aspell \
--disable-background \
--disable-vfs \
--disable-doxygen-doc \
--without-x \
--without-gpm-mouse \
--without-internal-edit \
--without-diff-viewer \
--without-subshell \
--enable-tests \
--enable-werror
make -j$(nproc)
make check
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-suite-logs-ubuntu
path: build-*/**/test-suite.log

34
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: CI
on: [ push, pull_request ]
jobs:
call-build-ubuntu:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/ci-ubuntu.yml
call-build-fedora:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/ci-fedora.yml
call-build-alpine:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/ci-alpine.yml
call-build-macos:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/ci-macos.yml
with:
# https://github.com/llvm/llvm-project/issues/20574
CFLAGS: -Wno-assign-enum
call-build-solaris:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/ci-solaris.yml
call-build-freebsd:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/ci-freebsd.yml
with:
# https://github.com/llvm/llvm-project/issues/20574
# https://github.com/GNUAspell/aspell/pull/651
CFLAGS: -Wno-assign-enum -Wno-strict-prototypes