-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: add 'gobenchdata action' to use gobenchdata action with custom G…
…o versions (#62)
- Loading branch information
Showing
9 changed files
with
205 additions
and
125 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
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
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,29 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
_ "embed" | ||
"os" | ||
"strings" | ||
|
||
"github.com/sourcegraph/run" | ||
) | ||
|
||
//go:embed entrypoint.sh | ||
var entrypointScript string | ||
|
||
// runEmbeddedAction executes an embedded version of entrypoint.sh | ||
func runEmbeddedAction(ctx context.Context) error { | ||
cmd := run.Cmd(ctx, "bash"). | ||
Input(strings.NewReader(entrypointScript)). | ||
StdOut() | ||
|
||
if executable, err := os.Executable(); err == nil { | ||
cmd = cmd.Env(map[string]string{ | ||
// point to self | ||
"GOBENCHDATA": executable, | ||
}) | ||
} | ||
|
||
return cmd.Run().Stream(os.Stdout) | ||
} |
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
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.
5a2f2cd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently broken, needs #63