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

Set new GOPATH env var to github actions #491

Merged
merged 7 commits into from
Feb 3, 2020

Conversation

alonyb
Copy link
Contributor

@alonyb alonyb commented Feb 2, 2020

This fixes the old way to set GOPATH to PATH.

This way is used by Minikube too.

I tested it and it works perfectly. logs

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 2, 2020
@codecov-io
Copy link

codecov-io commented Feb 2, 2020

Codecov Report

Merging #491 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #491   +/-   ##
=======================================
  Coverage   56.47%   56.47%           
=======================================
  Files          19       19           
  Lines         926      926           
=======================================
  Hits          523      523           
  Misses        350      350           
  Partials       53       53

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7842e57...d8e4ddc. Read the comment docs.

@ahmetb
Copy link
Member

ahmetb commented Feb 2, 2020

Could $() work instead of backticks?

Copy link
Contributor

@corneliusweig corneliusweig left a comment

Choose a reason for hiding this comment

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

Shouldn't we add the export ... to all commands involving some go tools? For example, go mod download will currently use the system go installation, correct?

@alonyb
Copy link
Contributor Author

alonyb commented Feb 2, 2020

Could $() work instead of backticks?

@ahmetb
Sure, looks better :) it's done

@alonyb
Copy link
Contributor Author

alonyb commented Feb 2, 2020

Shouldn't we add the export ... to all commands involving some go tools? For example, go mod download will currently use the system go installation, correct?

It is not necessary, that PATH is only used in 2 steps and I would not like to add the same line in all the steps, it does not look good :)

@ahmetb
Copy link
Member

ahmetb commented Feb 2, 2020

Is there a way to augment PATH for all steps? Maybe go path is always at $HOME/go/bin just like the default.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 3, 2020
@alonyb
Copy link
Contributor Author

alonyb commented Feb 3, 2020

Is there a way to augment PATH for all steps? Maybe go path is always at $HOME/go/bin just like the default.

@ahmetb
I just invented this.
how about?

@ahmetb
Copy link
Member

ahmetb commented Feb 3, 2020

@alonyb that looks perfect tbh and makes the steps easier.

@ahmetb
Copy link
Member

ahmetb commented Feb 3, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, alonyb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4303b6a into kubernetes-sigs:master Feb 3, 2020
set -euo pipefail
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
- name: Add GOPATH
Copy link
Contributor

Choose a reason for hiding this comment

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

This name seems wrong to me.

GOPATH is already set but we're adding its bin to PATH.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah the name could be better like Add GOPATH/bin to PATH.

Copy link
Contributor

Choose a reason for hiding this comment

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

sent #493, let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants