HACKING.md: add basic documentation for the development

This commit adds a basic HACKING.md that explains the bare mimimum
to get started, including `go test -short` to skip the expensive
tests.

Contains also a drive-by rename of the test dependency install
for the GH action.
This commit is contained in:
Michael Vogt 2024-11-29 12:45:45 +01:00 committed by Simon de Vlieger
parent e9e8dc5256
commit 8ae5b98d9d
2 changed files with 43 additions and 1 deletions

View file

@ -25,7 +25,7 @@ jobs:
run: sudo apt update
# This is needed for the container resolver dependencies
- name: Install libgpgme devel package
- name: Install test dependencies
run: sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev podman
- name: Build

42
HACKING.md Normal file
View file

@ -0,0 +1,42 @@
# Hacking on image-builder-cli
Hacking on `image-builder` should be fun and is easy.
We have unit tests and some integration testing.
## Setup
To work on bootc-image-builder one needs a working Go environment. See
[go.mod](go.mod).
To run the testsuite install the test dependencies as outlined in the
[github action](./.github/workflows/go.yml) under
"Install test dependencies".
## Code layout
The go source code of image-builder-cli is under
`./cmd/image-builder`. It uses the
[images](https://github.com/osbuild/images) library internally to
generate the images. Unit tests (and integration tests where it makes
sense) are expected to be part of every PR but we are happy to help if
those are missing from a PR.
## Build
Build by running:
```console
$ go build ./cmd/image-builder/
```
## Unit tests
Run the unit tests via:
```console
$ go test -short ./...
```
There are some integration tests that can be run via:
```console
$ go test ./...
```