Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change handling of ExtraPath #406

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

winksaville
Copy link
Contributor

To make the handling of ExtraPath portable append it to the front of the
PATH when it exists, instead of always changing the script.

To make the handling of ExtraPath portable append it to the front of the
PATH when it exists, instead of always changing the script.
@winksaville
Copy link
Contributor Author

@cplee I slept on your suggestion and came up with a different solution of adding ExtraPath to the PATH environment variable. Note: this is my first experience using Go so please don't laugh, but let me know your thoughts :)

When I run make build I get an error as I don't have a token although it seems to "work":

$ make build
cat: /home/wink/.config/github/token: No such file or directory
go build -ldflags "-X main.version=0.2.16-5-g70af6c1" -o dist/local/act main.go

But what I've been doing is just go build and that is working for my simple example I've created.

Finally, I tried to run make test and I get an error, not sure if that because of my change or the lack of a token or ...

$ make test
cat: /home/wink/.config/github/token: No such file or directory
go test ./...
?   	github.com/nektos/act	[no test files]
?   	github.com/nektos/act/cmd	[no test files]
ok  	github.com/nektos/act/pkg/common	(cached)
ok  	github.com/nektos/act/pkg/container	(cached)
ok  	github.com/nektos/act/pkg/model	(cached)
ok  	github.com/nektos/act/pkg/runner	22.111s
go run main.go
[push/Test    ] 🚀  Start image=node:12.6-buster-slim
[push/Lint    ] 🚀  Start image=node:12.6-buster-slim
[push/Lint    ]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[push/Test    ]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[push/Test    ]   🐳  docker cp src=/home/wink/prgs/nektos/forks/act/. dst=/github/workspace
[push/Lint    ]   🐳  docker cp src=/home/wink/prgs/nektos/forks/act/. dst=/github/workspace
[push/Lint    ] ⭐  Run actions/checkout@v2
[push/Lint    ]   ✅  Success - actions/checkout@v2
[push/Lint    ] ⭐  Run docker:https://golangci/golangci-lint:v1.23.8
[push/Test    ] ⭐  Run actions/checkout@v2
[push/Test    ]   ✅  Success - actions/checkout@v2
[push/Test    ] ⭐  Run actions/setup-go@v1
[push/Test    ]   ☁  git clone 'https://github.com/actions/setup-go' # ref=v1
[push/Test    ]   🐳  docker cp src=/home/wink/.cache/act/actions-setup-go@v1 dst=/actions/
[push/Test    ]   💬  ::debug::evaluating 11 versions
[push/Test    ]   💬  ::debug::matched: 1.14.10
[push/Test    ]   💬  ::debug::isExplicit: 1.14.10
[push/Test    ]   💬  ::debug::explicit? true
[push/Test    ]   💬  ::debug::checking cache: /opt/hostedtoolcache/go/1.14.10/x64
[push/Test    ]   💬  ::debug::not found
[push/Test    ]   💬  ::debug::Downloading Go from: https://storage.googleapis.com/golang/go1.14.10.linux-amd64.tar.gz
[push/Test    ]   💬  ::debug::Downloading https://storage.googleapis.com/golang/go1.14.10.linux-amd64.tar.gz
[push/Test    ]   💬  ::debug::Downloading /tmp/50b83d4d-7ccf-4163-817c-dd5e5c01db54
[push/Test    ]   💬  ::debug::download complete
| [command]/bin/tar xzC /tmp/40af3258-b2c0-43da-9c10-4953ef836cc3 -f /tmp/50b83d4d-7ccf-4163-817c-dd5e5c01db54
[push/Test    ]   💬  ::debug::Caching tool go 1.14.10 x64
[push/Test    ]   💬  ::debug::source dir: /tmp/40af3258-b2c0-43da-9c10-4953ef836cc3/go
[push/Test    ]   💬  ::debug::destination /opt/hostedtoolcache/go/1.14.10/x64
[push/Test    ]   💬  ::debug::finished caching tool
[push/Test    ]   💬  ::debug::Go tool is cached under /opt/hostedtoolcache/go/1.14.10/x64
[push/Test    ]   ⚙  ::set-env:: GOROOT=/opt/hostedtoolcache/go/1.14.10/x64
[push/Test    ]   ⚙  ::add-path:: /opt/hostedtoolcache/go/1.14.10/x64/bin
[push/Test    ]   ❓  ##[add-matcher]/actions/actions-setup-go@v1/.github/go.json
[push/Test    ]   ✅  Success - actions/setup-go@v1
[push/Test    ] ⭐  Run go test -cover ./...
| /github/workflow/2: line 1: go: command not found
[push/Test    ]   ❌  Failure - go test -cover ./...
Error: exit with `FAILURE`: 127
exit status 1
make: *** [Makefile:23: test] Error 1

Copy link
Contributor

@cplee cplee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cplee cplee merged commit 8204ef4 into nektos:master Nov 2, 2020
@winksaville
Copy link
Contributor Author

Thanks, what do I need to do so make test works for me locally?

@winksaville winksaville deleted the Change-handling-of-ExtraPath branch November 2, 2020 22:01
winksaville added a commit to winksaville/act that referenced this pull request Nov 4, 2020
In PR nektos#406 I used PathSeparator and I should have used PathListSeparator.
winksaville added a commit to winksaville/act that referenced this pull request Nov 4, 2020
In PR nektos#406 I used PathSeparator and I should have used PathListSeparator.
 See: https://golang.org/pkg/os/#pkg-constants
@winksaville winksaville mentioned this pull request Nov 4, 2020
cplee pushed a commit that referenced this pull request Nov 4, 2020
In PR #406 I used PathSeparator and I should have used PathListSeparator.
 See: https://golang.org/pkg/os/#pkg-constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants