Giter Site home page Giter Site logo

github-actions-vagrantup's Introduction

Run GitHub CI in VirtualBox via Vagrant

Use this action to run your CI in FreeBSD, OpenBSD, NetBSD, etc.

Sample workflow

name: Build
on: [push]
jobs:
  build-on-openbsd:
    runs-on: macos-12
    steps:
      - uses: actions/checkout@v2

      - uses: 5u623l20/github-actions-vagrantup@v1
        with:
          mem: 8192
          box: generic/openbsd6
          run: |
            export AUTOCONF_VERSION=2.69
            export AUTOMAKE_VERSION=1.16

            export CFLAGS='-I/usr/local/include -L/usr/local/lib'

            if [ ! -f /usr/local/lib/libiconv.so ] ; then
                sudo ln -s /usr/local/lib/libiconv.so.* /usr/local/lib/libiconv.so
            fi

            run sudo pkg_add automake-1.16.2

            run ./autogen.sh
            run ./configure --prefix=/usr
            run make
            run sudo make install
            run file /usr/bin/ctags
            run ctags --version
option required overview
runs-on ✔︎ must be macos-12 otherwise Github Action will fail prematurely
run ✔︎ the commands you want to run in vm
box ✔︎ the vagrant box name, the most commonly used are generic/freebsd11 generic/freebsd12 generic/netbsd8 generic/netbsd9 generic/openbsd6, you can find your appropriate box from https://app.vagrantup.com/boxes
mem the memory size of vm, default value is 8192 MB

All the GITHUB_* environment variables are passed into the VM.

The host machine folder ${GITHUB_WORKSPACE} has been synchronized into the VM folder ~/${GITHUB_REPOSITORY}.

The working dir of VM is ~/${GITHUB_REPOSITORY}

you can use run command in run option, the defination of run command as follow:

run() {
    printf "\033[0;35m==>\033[0m \033[0;32m%b\n\033[0m" "$*"
    $@
}

Under the hood

GitHub Actions only supports Ubuntu, Windows and macOS out of the box.

However, the macOS-12 support virtualization. It has VirtualBox and Vagrant installed.

So, we can run the FreeBSD, NetBSD, OpenBSD OS in VirbualBox on macOS-12.

github-actions-vagrantup's People

Contributors

5u623l20 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.