From e2df957687800ff7bd295492f72de02f64eb2e0f Mon Sep 17 00:00:00 2001 From: Cezar Craciunoiu Date: Wed, 13 Nov 2024 12:18:43 +0200 Subject: [PATCH] feat(action): Add option to skip building Signed-off-by: Cezar Craciunoiu --- action.yml | 5 +++++ tools/github-action/main.go | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 5978921ad..9e2d59cee 100644 --- a/action.yml +++ b/action.yml @@ -57,6 +57,10 @@ inputs: arch: description: Architecture to build for. required: false + build: + description: Toggle building the unikernel. + required: false + default: "true" plat: description: Platform to build for. required: false @@ -207,6 +211,7 @@ runs: -e "INPUT_ARCH=${{ inputs.arch }}" \ -e "INPUT_ARGS=${{ inputs.args }}" \ -e "INPUT_AUTHS=${{ inputs.auths }}" \ + -e "INPUT_BUILD=${{ inputs.build }}" \ -e "INPUT_EXECUTE=${{ inputs.execute }}" \ -e "INPUT_ROOTFS=${{ inputs.rootfs }}" \ -e "INPUT_KRAFTFILE=${{ inputs.kraftfile }}" \ diff --git a/tools/github-action/main.go b/tools/github-action/main.go index 55e72f6f3..cf1425e7f 100644 --- a/tools/github-action/main.go +++ b/tools/github-action/main.go @@ -41,6 +41,7 @@ type GithubAction struct { // Build flags Arch string `long:"arch" env:"INPUT_ARCH" usage:"Architecture to build for"` + Build bool `long:"build" env:"INPUT_BUILD" usage:"Toggle building the unikernel"` Plat string `long:"plat" env:"INPUT_PLAT" usage:"Platform to build for"` Target string `long:"target" env:"INPUT_TARGET" usage:"Name of the target to build for"` @@ -260,8 +261,10 @@ func (opts *GithubAction) Run(ctx context.Context, args []string) (err error) { return fmt.Errorf("could not pull project components: %w", err) } - if err := opts.build(ctx); err != nil { - return fmt.Errorf("could not build unikernel: %w", err) + if opts.Build { + if err := opts.build(ctx); err != nil { + return fmt.Errorf("could not build unikernel: %w", err) + } } if opts.Execute {