Closed RainbowMango closed 1 week ago
cc @liangyuanpeng @zhzhuang-zju
Tracing upstream issue:
seems like the reason is this workflow have a specially workspace path: https://github.com/karmada-io/karmada/blob/5e1191ffd774d969b293d1622f879062279720ed/.github/workflows/ci.yml#L50
Refer to https://github.com/actions/setup-go/blob/cdcb36043654635271a94b9a6d1392de5bb323a7/src/cache-restore.ts#L52-L65, when cache restore occurs, it looks for the go.sum
file at the next level of the directory ${{github.workspace}} and reports an error if it is not found. In our CI scenario, variable ${{github.workspace}} is /home/runner/work/karmada/karmada
, but the path of file go.sum
is /home/runner/work/karmada/karmada/src/github.com/karmada-io/karmada/go.sum
, so the action cannot find file go.sum
and print the warning log.
The reason for the inconsistency of the directory is what @liangyuanpeng said, this workflow have a specially workspace path. By tracing the history of the code, this specially workspace path was introduced in #1221 to solve the problem of ci failing to intercept the PR which introduced API change but without deepcopy update.
Thanks for the details analysis, do we have a solution to fix it?
Thanks for the details analysis, do we have a solution to fix it?
The easiest way is to remove the specially workspace path. I gave it a try and submitting a PR which introduced API change but without deepcopy update and didn't end up with the problem described in #1221, so I guess I'll have to look into the reasons for adding the specially workspace path on PR #1221.
The easiest way is to remove the specially workspace path. I gave it a try and submitting a PR which introduced API change but without deepcopy update and didn't end up with the problem described in #1221, so I guess I'll have to look into the reasons for adding the specially workspace path on PR #1221.
Through experimentation, directly deleting the specially workspace path will not affect the functionality of the CI, as can be seen in https://github.com/zhzhuang-zju/karmada/actions/runs/8966655310/job/24622621482.
The specific reason for this is the addition of this code inside the file hack/update-codegen.sh
https://github.com/karmada-io/karmada/blob/c7c8f4939663325a119b6341adb6bdd2de8066ec/hack/update-codegen.sh#L43-L45
This code sets the variable ${{GOPATH}} to a path under ${REPO_ROOT}, so CI doesn't need to run under path ${{ env.GOPATH }}/src/github.com/karmada-io/karmada
cc @RainbowMango @liangyuanpeng
Good job! @zhzhuang-zju
Can you send a PR for this?
/assign
What would you like to be added: Investigate if there is something wrong with the GitHub Action to address the warning:
You can get the warning from here: https://github.com/karmada-io/karmada/actions/runs/8957867986
References: https://github.com/actions/setup-go/issues/427
Why is this needed: