Skip to content

Commit

Permalink
GHA: Add OpenBSD job
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Mar 2, 2024
1 parent 05c2bfb commit 4e4d51a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

jobs:
main:
native:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -168,17 +168,23 @@ jobs:
if: matrix.coverage
run: ci/run.sh codecov

freebsd-vm:
vm:
strategy:
fail-fast: false
matrix:
include:
- job_name: FreeBSD 13.2 x64, DMD (latest)
freebsd_version: '13.2'
guest: freebsd
guest_version: '13.2'
host_dmd: dmd
- job_name: FreeBSD 13.2 x64, DMD (bootstrap)
freebsd_version: '13.2'
guest: freebsd
guest_version: '13.2'
host_dmd: dmd-2.095.0
- job_name: OpenBSD 7.4 x64, DMD (latest)
guest: openbsd
guest_version: '7.4'
host_dmd: dmd
name: ${{ matrix.job_name }}
runs-on: ubuntu-latest
timeout-minutes: 60
Expand All @@ -189,29 +195,32 @@ jobs:
- name: Run in VM
uses: cross-platform-actions/[email protected]
with:
operating_system: freebsd
operating_system: ${{ matrix.guest }}
version: ${{ matrix.guest_version }}
hypervisor: qemu
memory: 12G
cpu_count: 4
sync_files: runner-to-vm
version: ${{ matrix.freebsd_version }}
shell: bash
run: |
set -uexo pipefail
freebsd_version='${{ matrix.freebsd_version }}'
freebsd_major="${freebsd_version:0:2}"
export OS_NAME=freebsd
export OS_NAME='${{ matrix.guest }}'
export MODEL=64
export HOST_DMD='${{ matrix.host_dmd }}'
export N="$(nproc)"
export FULL_BUILD=true
export CI_DFLAGS="-version=TARGET_FREEBSD${freebsd_major}"
#if [[ "$freebsd_major" == 12 ]]; then
# sudo sed -i '' -e 's|pkg.FreeBSD.org|mirrors.xtom.com/freebsd-pkg|' /etc/pkg/FreeBSD.conf
#fi
if [[ "$OS_NAME" == "freebsd" ]]; then
freebsd_version='${{ matrix.guest_version }}'
freebsd_major="${freebsd_version:0:2}"
#if [[ "$freebsd_major" == 12 ]]; then
# sudo sed -i '' -e 's|pkg.FreeBSD.org|mirrors.xtom.com/freebsd-pkg|' /etc/pkg/FreeBSD.conf
#fi
export CI_DFLAGS="-version=TARGET_FREEBSD${freebsd_major}"
fi
bash --version
Expand Down
10 changes: 9 additions & 1 deletion ci/cirrusci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

set -uexo pipefail

# OS_NAME: linux|osx|freebsd
# OS_NAME: linux|osx|freebsd|openbsd
if [ -z ${OS_NAME+x} ] ; then echo "Variable 'OS_NAME' needs to be set."; exit 1; fi
# MODEL: 32|64
if [ -z ${MODEL+x} ] ; then echo "Variable 'MODEL' needs to be set."; exit 1; fi
Expand Down Expand Up @@ -37,4 +37,12 @@ elif [ "$OS_NAME" == "freebsd" ]; then
rm /usr/bin/make
ln -s /usr/local/bin/gmake /usr/bin/make
ln -s /usr/local/bin/llvm-dwarfdump12 /usr/bin/llvm-dwarfdump
elif [ "$OS_NAME" == "openbsd" ]; then
packages="git gmake llvm"
pkg_add $packages
# replace default make by GNU make
rm /usr/bin/make
ln -s /usr/local/bin/gmake /usr/bin/make
which llvm-dwarfdump || true
ls -l /usr/local/bin/llvm-dwarfdump*
fi
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -uexo pipefail

# N: number of parallel build jobs
if [ -z ${N+x} ] ; then echo "Variable 'N' needs to be set."; exit 1; fi
# OS_NAME: linux|osx|freebsd|windows
# OS_NAME: linux|osx|freebsd|openbsd|windows
if [ -z ${OS_NAME+x} ] ; then echo "Variable 'OS_NAME' needs to be set."; exit 1; fi
# FULL_BUILD: true|false (true on Linux: use full permutations for DMD tests)
if [ -z ${FULL_BUILD+x} ] ; then echo "Variable 'FULL_BUILD' needs to be set."; exit 1; fi
Expand Down

0 comments on commit 4e4d51a

Please sign in to comment.