GithubHelp home page GithubHelp logo

dpogue / solaris-vm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vmactions/solaris-vm

0.0 1.0 0.0 915 KB

Use Solaris in github actions

Home Page: https://vmactions.org

License: MIT License

JavaScript 100.00%

solaris-vm's Introduction

Run GitHub CI in Solaris

Use this action to run your CI in Solaris.

The github workflow only supports Ubuntu, Windows and MacOS. But what if you need a Solaris?

This action is to support Solaris.

Sample workflow solaris.yml:

name: Test

on: [push]

jobs:
  testsolaris:
    runs-on: macos-10.15
    name: A job to run test Solaris
    env:
      MYTOKEN : ${{ secrets.MYTOKEN }}
      MYTOKEN2: "value2"
    steps:
    - uses: actions/checkout@v2
    - name: Test in solaris
      id: test
      uses: vmactions/[email protected]
      with:
        envs: 'MYTOKEN MYTOKEN2'
        prepare: pkgutil -y -i socat
        nat: |
          "8080": "80"
          "8443": "443"
          udp:"8081": "80"
        run: |
          if [ -n "test" ]; then
            echo "false"
          fi
          if [ "test" ]; then
            echo "test"
          fi
          pwd
          ls -lah
          whoami
          env
          psrinfo -vp
          cat /etc/release
          echo "OK"

The runs-on: macos-latest must be macos-latest.

The envs: 'MYTOKEN MYTOKEN2' is the env names that you want to pass into solaris vm.

The run: xxxxx is the command you want to run in solaris vm.

The env variables are all copied into the VM, and the source code and directory are all synchronized into the VM.

The working dir for run in the VM is the same as in the Host machine.

All the source code tree in the Host machine are mounted into the VM.

All the GITHUB_* as well as CI=true env variables are passed into the VM.

So, you will have the same directory and same defualt env variables when you run the CI script.

You can add NAT port between the host and the VM.

...
    steps:
    - uses: actions/checkout@v2
    - name: Test in solaris
      id: test
      uses: vmactions/[email protected]
      with:
        envs: 'MYTOKEN MYTOKEN2'
        nat: |
          "8080": "80"
          "8443": "443"
          udp:"8081": "80"
...

The default memory of the VM is 4096MB, you can use mem option to set the memory size:

...
    steps:
    - uses: actions/checkout@v2
    - name: Test in solaris
      id: test
      uses: vmactions/[email protected]
      with:
        envs: 'MYTOKEN MYTOKEN2'
        mem: 5000
...

Under the hood

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

However, the MacOS support virtualization. It has VirtualBox installed.

So, we run the Solaris VM in VirbualBox on MacOS.

solaris-vm's People

Contributors

neilpang 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.