FreeBSD via Vagrant allows reuse of existing actions (#339)

Currently, there is a lot of duplicate CI config for FreeBSD jobs, this removes that redundancy.
This commit is contained in:
Hummeltech
2023-09-28 12:31:53 -07:00
committed by GitHub
parent 04a2ef0315
commit d13186ae7d
7 changed files with 103 additions and 58 deletions

View File

@ -10,16 +10,16 @@ runs:
shell: bash --noprofile --norc -euxo pipefail {0}
- name: Test `mod_tile`
run: ctest --exclude-regex 'clear_dirs|remove_tile' --output-on-failure
run: ctest --exclude-regex 'clear_dirs|remove_tiles' --output-on-failure
shell: bash --noprofile --norc -euxo pipefail {0}
working-directory: build
- name: Archive test artifacts on failure
if: failure()
run: |
TAR_FILENAME=${{ matrix.image || matrix.os }}-${{ matrix.compiler }}.tar.gz
TAR_FILENAME=${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}.tar.gz
TAR_FILENAME=$(echo "${TAR_FILENAME}" | sed 's/:/-/g')
tar -zcf /tmp/${TAR_FILENAME} tests
tar -zcf ${{ runner.temp }}/${TAR_FILENAME} tests
shell: bash --noprofile --norc -euxo pipefail {0}
working-directory: build
@ -28,4 +28,4 @@ runs:
uses: actions/upload-artifact@v3
with:
name: Test Artifacts
path: /tmp/*.tar.gz
path: ${{ runner.temp }}/*.tar.gz

View File

@ -45,6 +45,17 @@ inputs:
fedora-test-dependencies:
default: >-
httpd
freebsd-build-dependencies:
default: >-
apache24
cairo
coreutils
curl
glib
iniparser
libmemcached
mapnik
pkgconf
macos-build-dependencies:
default: >-
apr
@ -166,6 +177,15 @@ runs:
${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc gcc-c++' }}
if: startsWith(matrix.image, 'fedora:')
- name: Install Dependencies (FreeBSD)
uses: ./.github/actions/dependencies/install/pkg
with:
packages: >-
${{ inputs.freebsd-build-dependencies }}
${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake' }}
${{ matrix.compiler == 'GNU' && 'gcc' || 'llvm' }}
if: github.job == 'FreeBSD'
- name: Install Dependencies (macOS)
uses: ./.github/actions/dependencies/install/brew
with:
@ -174,7 +194,7 @@ runs:
${{ inputs.macos-test-dependencies }}
${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake' }}
${{ matrix.compiler == 'GNU' && 'gcc' || '' }}
if: runner.os == 'macOS'
if: github.job == 'macOS'
- name: Install Dependencies (Ubuntu)
uses: ./.github/actions/dependencies/install/apt-get

View File

@ -0,0 +1,15 @@
---
inputs:
packages:
description: List of package(s) to install
required: true
options:
default: --yes
description: Option(s) to pass
runs:
using: composite
steps:
- name: Install package(s)
run: ${{ !matrix.image && 'sudo' || '' }} pkg install ${{ inputs.options }} ${{ inputs.packages }}
shell: bash --noprofile --norc -euxo pipefail {0}

View File

@ -1,40 +0,0 @@
---
inputs:
build-dependencies:
default: >-
apache24
cairo
cmake
coreutils
curl
glib
iniparser
mapnik
pkgconf
description: List of build dependency package(s) to install
runs:
using: composite
steps:
- name: Install dependencies, Build, Test & Install `mod_tile`
uses: vmactions/freebsd-vm@v0.3.0
with:
mem: 4096
prepare: |
mkdir -p /usr/local/etc/pkg/repos
sed 's#/quarterly#/latest#g' /etc/pkg/FreeBSD.conf > /usr/local/etc/pkg/repos/FreeBSD.conf
pkg upgrade --yes
pkg install --yes ${{ inputs.build-dependencies }}
release: 13.1
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu)
export LIBRARY_PATH=/usr/local/lib
cmake -B build -S . \
-LA \
-DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX:-/usr/local} \
-DENABLE_TESTS:BOOL=ON
cmake --build build
ctest --test-dir build
cmake --install build
usesh: true

View File

@ -59,9 +59,7 @@ jobs:
container:
env:
CC: ${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc' }}
CFLAGS: ${{ (matrix.build_system == 'CMake' && matrix.compiler == 'GNU') && '--coverage' || '' }}
CXX: ${{ matrix.compiler == 'LLVM' && 'clang++' || 'g++' }}
CXXFLAGS: ${{ (matrix.build_system == 'CMake' && matrix.compiler == 'GNU') && '--coverage' || '' }}
image: ${{ matrix.image }}
steps:
- name: Install `git` (Amazon Linux 2)
@ -88,7 +86,10 @@ jobs:
CFLAGS: -Wno-implicit-function-declaration
LDFLAGS: -undefined dynamic_lookup
LIBRARY_PATH: /usr/local/lib
name: ${{ matrix.os }} (${{ matrix.build_system }}) (${{ matrix.compiler }})
name: >-
${{ matrix.os }}
(${{ matrix.build_system }})
(${{ matrix.compiler }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@ -132,12 +133,51 @@ jobs:
uses: ./.github/actions/install
FreeBSD:
if: contains(github.ref, 'master') || contains(github.ref, 'develop')
name: FreeBSD (CMake) (LLVM)
runs-on: macos-12
env:
BUILD_PARALLEL_LEVEL: 4
LIBRARY_PATH: /usr/local/lib
TMPDIR: /tmp
name: >-
${{ matrix.box_generic }}
(${{ matrix.build_system }})
(${{ matrix.compiler }})
runs-on: macos-latest
strategy:
matrix:
box_generic:
- freebsd12
build_system:
- CMake
compiler:
- LLVM
on_default_branch:
- ${{ contains(github.ref, 'master') || contains(github.ref, 'develop') }}
include:
- box_generic: freebsd13
build_system: CMake
compiler: LLVM
exclude:
- on_default_branch: false
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies, Build, Test & Install `mod_tile`
uses: ./.github/actions/freebsd
- name: Provision VM
uses: hummeltech/freebsd-vagrant-action@v1.3
with:
box: generic/${{ matrix.box_generic }}
cpus: ${{ env.BUILD_PARALLEL_LEVEL }}
memory: 4096
- name: Install dependencies
uses: ./.github/actions/dependencies/install
- name: Build `mod_tile`
uses: ./.github/actions/build
- name: Test `mod_tile`
uses: ./.github/actions/test
- name: Install `mod_tile`
uses: ./.github/actions/install