Skip to content

Commit c7f7d03

Browse files
committed
ci: rework bsd workflows
freebsd: hide Vagrantfile from guest
1 parent eb6dc87 commit c7f7d03

File tree

5 files changed

+110
-32
lines changed

5 files changed

+110
-32
lines changed

.github/workflows/amd64_bsd_cmake.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 BSD CMake
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
concurrency:
7+
group: ${{github.workflow}}-${{github.ref}}
8+
cancel-in-progress: true
9+
10+
# Building using the github runner environement directly.
11+
jobs:
12+
vagrant:
13+
strategy:
14+
matrix:
15+
distro: [
16+
freebsd,
17+
netbsd,
18+
openbsd,
19+
]
20+
allow_failure: [true]
21+
fail-fast: false
22+
name: amd64•${{matrix.distro}}•CMake
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Virtualbox install
27+
run: |
28+
sudo apt update -q
29+
sudo apt install -yq virtualbox
30+
virtualbox --help
31+
- name: Vagrant install
32+
run: |
33+
sudo apt update -q
34+
wget https://releases.hashicorp.com/vagrant/2.4.7/vagrant_2.4.7-1_amd64.deb
35+
sudo apt install -y ./vagrant_2.4.7-1_amd64.deb
36+
vagrant --version
37+
- name: Build
38+
run: make --directory=ci ${{matrix.distro}}_build
39+
40+
amd64_bsd_cmake:
41+
runs-on: ubuntu-latest
42+
needs: vagrant
43+
steps:
44+
- uses: actions/checkout@v4

.github/workflows/amd64_freebsd_cmake.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

ci/vagrant/freebsd/Vagrantfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Vagrant.configure("2") do |config|
1414
# boxes at https://vagrantcloud.com/search.
1515
config.vm.guest = :freebsd
1616
config.vm.box = "generic/freebsd14"
17+
config.vm.box_version = "4.3.12"
1718
config.vm.provider "virtualbox" do |v|
1819
v.name = "ci_freebsd"
1920
end
@@ -48,9 +49,14 @@ Vagrant.configure("2") do |config|
4849
# the path on the host to the actual folder. The second argument is
4950
# the path on the guest to mount the folder. And the optional third
5051
# argument is a set of non-required options.
51-
#config.vm.synced_folder "../../..", "/home/vagrant/project"
52-
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
52+
# config.vm.synced_folder "../data", "/vagrant_data"
5353

54+
# Disable the default share of the current code directory. Doing this
55+
# provides improved isolation between the vagrant box and your host
56+
# by making sure your Vagrantfile isn't accessible to the vagrant box.
57+
# If you use this you may want to enable additional shared subfolders as
58+
# shown above.
59+
config.vm.synced_folder ".", "/vagrant", disabled: true
5460

5561
# Provider-specific configuration so you can fine-tune various
5662
# backing providers for Vagrant. These expose provider-specific options.
@@ -79,6 +85,7 @@ Vagrant.configure("2") do |config|
7985

8086
config.vm.provision "file", source: "../../../CMakeLists.txt", destination: "$HOME/project/"
8187
config.vm.provision "file", source: "../../../cmake", destination: "$HOME/project/"
88+
config.vm.provision "file", source: "../../../patches", destination: "$HOME/project/"
8289
config.vm.provision "file", source: "../../../Foo", destination: "$HOME/project/"
8390
config.vm.provision "file", source: "../../../Bar", destination: "$HOME/project/"
8491
config.vm.provision "file", source: "../../../FooBar", destination: "$HOME/project/"

ci/vagrant/netbsd/Vagrantfile

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ Vagrant.configure("2") do |config|
1313
# Every Vagrant development environment requires a box. You can search for
1414
# boxes at https://vagrantcloud.com/search.
1515
config.vm.guest = :netbsd
16-
config.vm.box = "generic/netbsd9"
16+
# config.vm.box = "generic/netbsd9"
17+
# config.vm.box_version = "4.3.12"
18+
19+
config.vm.box = "NetBSD/NetBSD-9.1"
20+
config.vm.box_version = "1.0.0"
21+
1722
config.vm.provider "virtualbox" do |v|
1823
v.name = "ci_netbsd"
1924
end
@@ -48,9 +53,14 @@ Vagrant.configure("2") do |config|
4853
# the path on the host to the actual folder. The second argument is
4954
# the path on the guest to mount the folder. And the optional third
5055
# argument is a set of non-required options.
51-
#config.vm.synced_folder "../../..", "/home/vagrant/project"
52-
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
56+
# config.vm.synced_folder "../data", "/vagrant_data"
5357

58+
# Disable the default share of the current code directory. Doing this
59+
# provides improved isolation between the vagrant box and your host
60+
# by making sure your Vagrantfile isn't accessible to the vagrant box.
61+
# If you use this you may want to enable additional shared subfolders as
62+
# shown above.
63+
config.vm.synced_folder ".", "/vagrant", disabled: true
5464

5565
# Provider-specific configuration so you can fine-tune various
5666
# backing providers for Vagrant. These expose provider-specific options.
@@ -73,12 +83,28 @@ Vagrant.configure("2") do |config|
7383
# note: clang installed by default
7484
config.vm.provision "env", type: "shell", inline:<<-SHELL
7585
set -x
76-
pkg update -f
77-
pkg install -y git cmake
86+
pkgin upgrade
87+
pkgin -y install git cmake
88+
pkgin -y install mozilla-rootcerts-openssl
89+
SHELL
90+
91+
config.vm.provision "gcc14", type: "shell", inline:<<-SHELL
92+
set -x
93+
pkgin -y install gcc14
7894
SHELL
7995

96+
# config.vm.provision "gcc14", type: "shell", inline:<<-SHELL
97+
# set -x
98+
# ftp ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc-2024Q4/pkgsrc.tar.gz
99+
# tar -xzf pkgsrc.tar.gz -C /usr
100+
# ls /usr/pkgsrc/lang
101+
# cd /usr/pkgsrc/lang/gcc14
102+
# make install clean clean-depens -j4
103+
# SHELL
104+
80105
config.vm.provision "file", source: "../../../CMakeLists.txt", destination: "$HOME/project/"
81106
config.vm.provision "file", source: "../../../cmake", destination: "$HOME/project/"
107+
config.vm.provision "file", source: "../../../patches", destination: "$HOME/project/"
82108
config.vm.provision "file", source: "../../../Foo", destination: "$HOME/project/"
83109
config.vm.provision "file", source: "../../../Bar", destination: "$HOME/project/"
84110
config.vm.provision "file", source: "../../../FooBar", destination: "$HOME/project/"
@@ -94,6 +120,8 @@ Vagrant.configure("2") do |config|
94120
config.vm.provision "configure", type: "shell", inline:<<-SHELL
95121
set -x
96122
cd project
123+
export CC=/usr/pkg/gcc14/bin/gcc
124+
export CXX=/usr/pkg/gcc14/bin/g++
97125
cmake -S. -Bbuild
98126
SHELL
99127

ci/vagrant/openbsd/Vagrantfile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ Vagrant.configure("2") do |config|
1313
# Every Vagrant development environment requires a box. You can search for
1414
# boxes at https://vagrantcloud.com/search.
1515
config.vm.guest = :openbsd
16-
config.vm.box = "generic/openbsd7"
16+
# config.vm.box = "generic/openbsd7" # OpenBSD 7.4
17+
# config.vm.box_version = "4.3.12"
18+
19+
config.vm.box = "twingly/openbsd-7.6"
20+
config.vm.box_version = "1.0.0"
21+
1722
config.vm.provider "virtualbox" do |v|
1823
v.name = "ci_openbsd"
1924
end
@@ -48,9 +53,14 @@ Vagrant.configure("2") do |config|
4853
# the path on the host to the actual folder. The second argument is
4954
# the path on the guest to mount the folder. And the optional third
5055
# argument is a set of non-required options.
51-
#config.vm.synced_folder "../../..", "/home/vagrant/project"
52-
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
56+
# config.vm.synced_folder "../data", "/vagrant_data"
5357

58+
# Disable the default share of the current code directory. Doing this
59+
# provides improved isolation between the vagrant box and your host
60+
# by making sure your Vagrantfile isn't accessible to the vagrant box.
61+
# If you use this you may want to enable additional shared subfolders as
62+
# shown above.
63+
# config.vm.synced_folder ".", "/vagrant", disabled: true
5464

5565
# Provider-specific configuration so you can fine-tune various
5666
# backing providers for Vagrant. These expose provider-specific options.
@@ -71,14 +81,23 @@ Vagrant.configure("2") do |config|
7181
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
7282
# documentation for more information about their specific syntax and use.
7383
# note: clang installed by default
84+
85+
# Vagrant provide a openBSD 7.4 box while only 7.6 and 7.7 are still
86+
# maintained by openBSD -> older registry have been shutdown.
87+
# config.vm.provision "env", type: "shell", inline:<<-SHELL
88+
# set -x
89+
# sysupgrade
90+
# SHELL
91+
7492
config.vm.provision "env", type: "shell", inline:<<-SHELL
7593
set -x
76-
pkg update -f
77-
pkg install -y git cmake
94+
pkg_add -u
95+
pkg_add git cmake
7896
SHELL
7997

8098
config.vm.provision "file", source: "../../../CMakeLists.txt", destination: "$HOME/project/"
8199
config.vm.provision "file", source: "../../../cmake", destination: "$HOME/project/"
100+
config.vm.provision "file", source: "../../../patches", destination: "$HOME/project/"
82101
config.vm.provision "file", source: "../../../Foo", destination: "$HOME/project/"
83102
config.vm.provision "file", source: "../../../Bar", destination: "$HOME/project/"
84103
config.vm.provision "file", source: "../../../FooBar", destination: "$HOME/project/"

0 commit comments

Comments
 (0)