check if VirtualBox package is installed rather than virtualbox program #141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker build | |
# on: [push] | |
on: | |
push: | |
paths: | |
- 'usr/bin/installer-dist' | |
- '.github/workflows/builds.yml' | |
jobs: | |
changes: | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: read | |
outputs: | |
builds: ${{ steps.filter.outputs.builds }} | |
installer: ${{ steps.filter.outputs.installer }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
installer: | |
- 'usr/bin/installer-dist' | |
builds: | |
- '.github/workflows/builds.yml' | |
build: | |
needs: changes | |
# if: ${{ (needs.changes.outputs.installer == 'true') }} | |
# if: ${{ (needs.changes.outputs.builds == 'true') }} | |
if: ${{ (needs.changes.outputs.installer == 'true' || needs.changes.outputs.builds == 'true') }} | |
## Github takes too long to set the current latest image, this is | |
## why we set it manually. | |
## https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- image: debian:oldstable | |
- image: debian:stable | |
- image: debian:testing | |
- image: ubuntu:latest | |
- image: linuxmintd/mint21.2-amd64:latest | |
- image: fedora:latest | |
container: | |
image: ${{ matrix.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: System Basic Packages | |
run: | | |
if command -v apt-get; then | |
apt-get update -y && apt-get install -y shellcheck sudo | |
elif command -v dnf; then | |
dnf update -y && dnf install -y ShellCheck sudo | |
else | |
exit 1 | |
fi | |
- name: System information | |
run: | | |
cat /etc/os-release | |
uname -a | |
echo "${PATH}" | |
cat /etc/sudoers | |
ls /etc/sudoers.d | |
- name: Normal user with sudo privileges | |
run: | | |
if test -f /etc/debian_version; then | |
adduser --gecos "" --disabled-password user | |
usermod -aG sudo user | |
echo "%sudo ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/user | |
elif test -f /etc/fedora-release; then | |
adduser user | |
usermod -aG wheel user | |
echo "%wheel ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/user | |
else | |
exit 1 | |
fi | |
- name: Run default installer-dist | |
#run: su -s /bin/bash user -- usr/bin/installer-dist --non-interactive --log-level=debug --no-boot --dev --ci | |
run: sudo -u user -- usr/bin/installer-dist --non-interactive --log-level=debug --no-boot --dev --ci | |
- name: Run VirtualBox Installer - default repository | |
run: sudo -u user -- usr/bin/installer-dist --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only | |
- name: Run VirtualBox Installer - Oracle repository | |
run: sudo -u user -- usr/bin/installer-dist --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only --oracle-repo | |
- name: Run Installer ShellCheck | |
run: shellcheck usr/bin/installer-dist |