Skip to content

Commit

Permalink
Revamp OpenBSD and Solaris with newer vmactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmonz committed Jan 24, 2024
1 parent cfc00d9 commit 146107f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 75 deletions.
63 changes: 28 additions & 35 deletions .github/workflows/openbsd.yml
@@ -1,49 +1,42 @@
name: C CI on OpenBSD
name: OpenBSD

on:
push:
branches:
- '*'
pull_request:
branches: [ master ]
branches: ['**', '!master']
pull_request_target:
branches: ['master']
types:
- closed

jobs:
build:
name: OpenBSD-${{ matrix.config.name }}
# see https://github.com/vmactions/openbsd-vm: must be macos-12
runs-on: macos-12
env:
CFLAGS: ${{ matrix.config.cflags }}
NROFF: ${{ matrix.config.nroff }}
build-openbsd:
if: github.event_name == 'push' || github.event.pull_request.merged == true
name: >
${{ matrix.osversion }}
${{ matrix.abi == '64' && ' ' || matrix.abi }}
${{ matrix.nroff == 'nroff' && ' ' || matrix.nroff }}
${{ matrix.nroff == 'no-roff' && 'no-obsolete' || ' ' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
name: "default64",
nroff: "nroff",
cflags: ""
}
- {
name: "no_obsolete64",
nroff: "true",
cflags: "-DDEPRECATED_FUNCTIONS_REMOVED"
}

osversion: ["7.4", "7.3", "7.2"]
abi: [64] # 32
nroff: ["mandoc", "no-roff"]
steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4

- name: Test in OpenBSD
id: test
uses: vmactions/openbsd-vm@v0
- name: Build and Test
uses: vmactions/openbsd-vm@v1
with:
envs: 'CFLAGS NROFF'
release: ${{ matrix.osversion }}
usesh: true
prepare: |
set -e
pkg_add check
run: |
echo "cc -m64 -O2 ${CFLAGS}" > conf-cc
echo "cc -m64 -s" > conf-ld
make it man NROFF=${NROFF}
cd tests
make test
set -e
echo "cc -m${{ matrix.abi }} -O2 ${{ matrix.nroff == 'no-roff' && '-DDEPRECATED_FUNCTIONS_REMOVED' || ' ' }}" > conf-cc
echo "cc -m${{ matrix.abi }} -s" > conf-ld
make -j 2 it man NROFF=${{ matrix.nroff == 'no-roff' && 'true' || matrix.nroff }}
make -j 2 test
73 changes: 33 additions & 40 deletions .github/workflows/solaris.yml
@@ -1,57 +1,50 @@
name: C CI on Solaris
name: Solaris

on:
push:
branches:
- '*'
pull_request:
branches: [ master ]
branches: ['**', '!master']
pull_request_target:
branches: ['master']
types:
- closed

jobs:
build:
name: Solaris-${{ matrix.config.name }}
# see https://github.com/vmactions/solaris-vm: must be macos-12
runs-on: macos-12
env:
CFLAGS: ${{ matrix.config.cflags }}
NROFF: ${{ matrix.config.nroff }}
LIBCHECK_VERSION: "0.15.2"
build-solaris:
if: github.event_name == 'push' || github.event.pull_request.merged == true
name: >
${{ matrix.osversion }}
${{ matrix.abi == '64' && ' ' || matrix.abi }}
${{ matrix.nroff == 'nroff' && ' ' || matrix.nroff }}
${{ matrix.nroff == 'no-roff' && 'no-obsolete' || ' ' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
name: default64,
nroff: nroff,
cflags: ""
}
- {
name: no_obsolete64,
nroff: true,
cflags: "-DDEPRECATED_FUNCTIONS_REMOVED"
}

osversion: ["11.4"] # "11.4-gcc"
abi: [64] # 32
nroff: ["nroff", "no-roff"]
libcheck: ["0.15.2"]
steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4

- name: Test in Solaris
id: test
uses: vmactions/solaris-vm@v0
- name: Build and Test
uses: vmactions/solaris-vm@v1
with:
envs: 'CFLAGS NROFF LIBCHECK_VERSION'
release: ${{ matrix.osversion }}
usesh: true
prepare: |
set -e
pkgutil -y -i gcc4core pkgconfig curl
curl -L -O https://github.com/libcheck/check/releases/download/${LIBCHECK_VERSION}/check-${LIBCHECK_VERSION}.tar.gz
gunzip check-${LIBCHECK_VERSION}.tar.gz
tar -xvf check-${LIBCHECK_VERSION}.tar
cd check-${LIBCHECK_VERSION}
env CFLAGS="-m64" ./configure --prefix=/opt/csw && gmake && gmake install
curl -L -O https://github.com/libcheck/check/releases/download/${{ matrix.libcheck }}/check-${{ matrix.libcheck }}.tar.gz
gunzip check-${{ matrix.libcheck }}.tar.gz
tar -xvf check-${{ matrix.libcheck }}.tar
cd check-${{ matrix.libcheck }}
env CFLAGS="-m${{ matrix.abi }}" ./configure --prefix=/opt/csw && gmake && gmake install
sed -e 's|^Libs: |Libs: -Wl,-R${libdir} |' < /opt/csw/lib/pkgconfig/check.pc > /opt/csw/lib/pkgconfig/check.pc.tmp && mv /opt/csw/lib/pkgconfig/check.pc.tmp /opt/csw/lib/pkgconfig/check.pc
run: |
echo "gcc -m64 -O2 -pipe ${CFLAGS}" > conf-cc
set -e
echo "gcc -m${{ matrix.abi }} -O2 -pipe ${{ matrix.nroff == 'no-roff' && '-DDEPRECATED_FUNCTIONS_REMOVED' || ' ' }}" > conf-cc
sed -e 's|ar cr |ar Scr |g' make-makelib.sh > make-makelib.sh.tmp && mv make-makelib.sh.tmp make-makelib.sh
echo "gcc -m64 -s" > conf-ld
make it man NROFF=${NROFF}
cd tests
echo "gcc -m${{ matrix.abi }} -s" > conf-ld
make it man NROFF=${{ matrix.nroff == 'no-roff' && 'true' || matrix.nroff }}
make test

0 comments on commit 146107f

Please sign in to comment.