-
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.
Merge tag 'debian/0.0.9-1' into droidian
golang-github-go-debos-fakemachine Debian release 0.0.9-1
- Loading branch information
Showing
32 changed files
with
1,431 additions
and
426 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,98 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '*.tmp' | ||
# Build at 04:00am every Monday | ||
schedule: | ||
- cron: "0 4 * * 1" | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v5 | ||
- uses: actions/checkout@v4 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
|
||
man-page: | ||
name: Check if man page has been regenerated | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y pandoc | ||
# Don't check the diff of the final manpage, instead check the | ||
# intermediate markdownfile instead as it is a lot less likely to | ||
# drastically change with different versions of pandoc etc. | ||
cd doc/man/ && ./create_manpage.sh | ||
git checkout *.1 | ||
git diff --exit-code | ||
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: [bookworm, trixie] | ||
backend: [qemu, uml, kvm] | ||
include: | ||
- os: arch | ||
backend: "qemu" | ||
- os: arch | ||
backend: "kvm" | ||
name: Test ${{matrix.os}} with ${{matrix.backend}} backend | ||
runs-on: ${{ matrix.backend == 'kvm' && 'kvm' || 'ubuntu-latest' }} | ||
defaults: | ||
run: | ||
shell: bash | ||
container: | ||
image: ghcr.io/go-debos/test-containers/${{matrix.os}}:main | ||
options: >- | ||
--security-opt label=disable | ||
--cap-add=SYS_PTRACE | ||
--tmpfs /scratch:exec | ||
${{ matrix.backend == 'kvm' && '--device /dev/kvm' || '' }} | ||
env: | ||
TMP: /scratch | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- 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 success status against | ||
allgreen: | ||
name: allgreen | ||
if: always() | ||
needs: | ||
- golangci | ||
- man-page | ||
- test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
fakemachine | ||
/fakemachine | ||
.*swp |
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,6 @@ | ||
linters: | ||
enable: | ||
- errorlint | ||
- gofmt | ||
- stylecheck | ||
- 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,26 @@ | ||
# fakemachine - fake a machine | ||
|
||
Creates a virtual machine based on the currently running system. | ||
|
||
## Synopsis | ||
|
||
``` | ||
fakemachine [options] <command to run inside machine> | ||
fakemachine [--help] | ||
``` | ||
|
||
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.