Skip to content

Commit

Permalink
Fix #1: Add support for NetBSD guest
Browse files Browse the repository at this point in the history
Because Xhyve doesn't support NetBSD, this also adds a new hypervisor,
QEMU.
  • Loading branch information
jacob-carlborg committed Nov 11, 2021
1 parent d8316a4 commit e766b18
Show file tree
Hide file tree
Showing 18 changed files with 6,360 additions and 10,195 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
"@typescript-eslint/no-shadow": "error",
"i18n-text/no-en": "off",
"sort-imports": "off",
"filenames/match-regex": [2, "^[a-z_]+$", true]
},
"env": {
"node": true,
Expand Down
34 changes: 30 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,45 @@ jobs:

test: # make sure the action works on a clean machine without building
name: ${{ matrix.os.name }} ${{ matrix.os.version }}
runs-on: macos-10.15
runs-on: ${{ matrix.os.host }}
strategy:
fail-fast: false
matrix:
os:
- name: FreeBSD
version: 12.2
host: macos-10.15
workDirectory: /Users/runner/work/action/action
uname:
hardware: amd64
release: 12.2-RELEASE

- name: FreeBSD
version: '13.0'
host: macos-10.15
workDirectory: /Users/runner/work/action/action
uname:
hardware: amd64
release: 13.0-RELEASE

- name: OpenBSD
version: 6.8
host: macos-10.15
workDirectory: /Users/runner/work/action/action
uname:
hardware: amd64

- name: OpenBSD
version: 6.9
host: macos-10.15
workDirectory: /Users/runner/work/action/action
uname:
hardware: amd64

- name: NetBSD
version: 9.2
host: ubuntu-latest
workDirectory: /home/runner/work/action/action
uname:
hardware: amd64

Expand All @@ -45,6 +66,9 @@ jobs:
with:
persist-credentials: false

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: ${{ matrix.os.name }}
uses: ./
env:
Expand All @@ -55,11 +79,13 @@ jobs:
operating_system: ${{ matrix.os.name }}
version: ${{ matrix.os.version }}
run: |
[ "`uname -s`" = '${{ matrix.os.name }}' ]
[ "`uname -r`" = '${{ matrix.os.uname.release || matrix.os.version }}' ]
[ "`uname -m`" = '${{ matrix.os.uname.hardware }}' ]
uname -a
echo $SHELL
pwd
ls -lah
whoami
env | sort
[ "`uname -s`" = '${{ matrix.os.name }}' ]
[ "`uname -r`" = '${{ matrix.os.uname.release || matrix.os.version }}' ]
[ "`uname -m`" = '${{ matrix.os.uname.hardware }}' ]
[ "`pwd`" = '${{ matrix.os.workDirectory }}' ]
29 changes: 29 additions & 0 deletions __tests__/architecture.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as architecture from '../src/architecture'

test('toString(Kind) - arm64', () => {
expect(architecture.toString(architecture.Kind.arm64)).toBe('arm64')
})

test('toString(Kind) - x86_64', () => {
expect(architecture.toString(architecture.Kind.x86_64)).toBe('x86-64')
})

test('toKind(string) - arm64', () => {
expect(architecture.toKind('arm64')).toBe(architecture.Kind.arm64)
})

test('toKind(string) - ARM64', () => {
expect(architecture.toKind('arm64')).toBe(architecture.Kind.arm64)
})

test('toKind(string) - x86_64', () => {
expect(architecture.toKind('x86-64')).toBe(architecture.Kind.x86_64)
})

test('toKind(string) - X86_64', () => {
expect(architecture.toKind('x86-64')).toBe(architecture.Kind.x86_64)
})

test('toKind(string) - invalid architecture', () => {
expect(architecture.toKind('null')).toBe(undefined)
})
8 changes: 0 additions & 8 deletions __tests__/operating_system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@ test('toKind - valid operating system', () => {
test('toKind - invalid operating system', () => {
expect(os.toKind('null')).toBe(undefined)
})

test('toString(Architecture) - arm64', () => {
expect(os.toString(os.Architecture.arm64)).toBe('arm64')
})

test('toString(Architecture) - x86_64', () => {
expect(os.toString(os.Architecture.x86_64)).toBe('x86-64')
})
Loading

0 comments on commit e766b18

Please sign in to comment.