Skip to content

Commit

Permalink
feat(action): Add option to skip building
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
  • Loading branch information
craciunoiuc committed Nov 19, 2024
1 parent f9a3396 commit e2df957
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}" \
Expand Down
7 changes: 5 additions & 2 deletions tools/github-action/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e2df957

Please sign in to comment.