Skip to content

v3.0: Upgrade vagrant-action and use virtualbox #105

v3.0: Upgrade vagrant-action and use virtualbox

v3.0: Upgrade vagrant-action and use virtualbox #105

Workflow file for this run

---
name: Tests
on:
push:
jobs:
FreeBSD-On-Linux:
name: ${{ matrix.box }}
runs-on: ubuntu-latest
strategy:
matrix:
box:
- generic/freebsd13
- generic/freebsd14
- freebsd/FreeBSD-13.4-STABLE
- freebsd/FreeBSD-14.1-STABLE
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set `CPUS`
run: |
echo "CPUS=$(nproc)" >> ${GITHUB_ENV}
- name: Provision VM
uses: ./
with:
box: ${{ matrix.box }}
cpus: ${{ env.CPUS }}
provider: virtualbox
- name: Run Test (uname) (VM)
run: |
if [ "$(uname -s)" = "FreeBSD" ]; then
echo "FreeBSD detected."
else
echo "FreeBSD not detected."
exit 1
fi
shell: bash --noprofile --norc -euo pipefail {0}
- name: Run Test (uname) (Host)
run: |
if [ "$(uname -s)" = "Linux" ]; then
echo "Linux detected."
else
echo "Linux not detected."
exit 1
fi
shell: /bin/bash --noprofile --norc -euo pipefail {0}
- name: Prepare Test (working-directory) (VM)
run: |
mkdir new_working_directory
shell: bash --noprofile --norc -euo pipefail {0}
- name: Run Test (working-directory) (VM)
run: |
if [ "$(basename ${PWD})" = "new_working_directory" ]; then
echo "Expected working directory detected."
else
echo "Expected working directory not detected."
exit 1
fi
shell: bash --noprofile --norc -euo pipefail {0}
working-directory: new_working_directory
FreeBSD-On-macOS:
name: ${{ matrix.box }}
runs-on: macos-13
strategy:
matrix:
box:
- freebsd/FreeBSD-13.4-STABLE
- freebsd/FreeBSD-14.1-STABLE
- generic/freebsd13
- generic/freebsd14
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set `CPUS`
run: |
echo "CPUS=$(getconf _NPROCESSORS_ONLN)" >> ${GITHUB_ENV}
- name: Provision VM
uses: ./
with:
box: ${{ matrix.box }}
cpus: ${{ env.CPUS }}
- name: Run Test (uname) (VM)
run: |
if [ "$(uname -s)" = "FreeBSD" ]; then
echo "FreeBSD detected."
else
echo "FreeBSD not detected."
exit 1
fi
shell: bash --noprofile --norc -euo pipefail {0}
- name: Run Test (uname) (Host)
run: |
if [ "$(uname -s)" = "Darwin" ]; then
echo "Darwin detected."
else
echo "Darwin not detected."
exit 1
fi
shell: /bin/bash --noprofile --norc -euo pipefail {0}
- name: Prepare Test (working-directory) (VM)
run: |
mkdir new_working_directory
shell: bash --noprofile --norc -euo pipefail {0}
- name: Run Test (working-directory) (VM)
run: |
if [ "$(basename ${PWD})" = "new_working_directory" ]; then
echo "Expected working directory detected."
else
echo "Expected working directory not detected."
exit 1
fi
shell: bash --noprofile --norc -euo pipefail {0}
working-directory: new_working_directory