-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
858 additions
and
302 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '*.tmp' | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
|
||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Currently nested virtualisation (hence kvm) is not supported on GitHub | ||
# actions; but the qemu backend is enough to test Fakemachine | ||
# functionality without hardware acceleration since the majority of code | ||
# is shared between the qemu and kvm backends. | ||
# See https://github.com/actions/runner-images/issues/183 | ||
# | ||
# For Arch Linux uml is not yet supported, so only test under qemu there. | ||
os: [bullseye, bookworm] | ||
backend: [qemu, uml] | ||
include: | ||
- os: arch | ||
backend: qemu | ||
name: Test ${{matrix.os}} with ${{matrix.backend}} backend | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
container: | ||
image: ghcr.io/go-debos/test-containers/fakemachine-${{matrix.os}}:main | ||
options: >- | ||
--security-opt label=disable | ||
--cap-add=SYS_PTRACE | ||
--tmpfs /scratch:exec | ||
env: | ||
TMP: /scratch | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Test build | ||
run: go build -o fakemachine cmd/fakemachine/main.go | ||
|
||
- name: Run unit tests (${{matrix.backend}} backend) | ||
run: go test -v ./... --backend=${{matrix.backend}} | tee test.out | ||
|
||
- name: Ensure no tests were skipped | ||
run: "! grep -q SKIP test.out" | ||
|
||
# Job to key the bors success status against | ||
bors: | ||
name: bors | ||
if: success() | ||
needs: | ||
- golangci | ||
- test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark the job as a success | ||
run: exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
linters: | ||
enable: | ||
- gofmt | ||
- whitespace |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# fakemchine - fake a machine | ||
|
||
Creates a vm based on the currently running system. | ||
|
||
## Synopsis | ||
|
||
fakemachine [OPTIONS] | ||
|
||
``` | ||
Application Options: | ||
-b, --backend=[auto|kvm|uml|qemu] Virtualisation backend to use (default: auto) | ||
-v, --volume= volume to mount | ||
-i, --image= image to add | ||
-e, --environ-var= Environment variables (use -e VARIABLE:VALUE syntax) | ||
-m, --memory= Amount of memory for the fakemachine in megabytes | ||
-c, --cpus= Number of CPUs for the fakemachine | ||
-s, --scratchsize= On-disk scratch space size (with a unit suffix, e.g. 4G); if unset, | ||
memory backed scratch space is used | ||
--show-boot Show boot/console messages from the fakemachine | ||
Help Options: | ||
-h, --help Show this help message | ||
``` |
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
Oops, something went wrong.