-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix credentials not passed or configured the CI workflow #286
Conversation
The new actions is also able to set credentials, and we add an example on how to set credentials for projects that have private dependencies. We also move the step to the beginning, in case the submodule dependencies are private. Signed-off-by: Leandro Lucarella <[email protected]>
If we do a Git checkout, there is the chance that we also need to fetch some private submodule we need credentials for. Signed-off-by: Leandro Lucarella <[email protected]> # ------------------------ >8 ------------------------ # Do not modify or remove the line above. # Everything below it will be ignored. # # Conflicts: # tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/ci.yaml
FYI @cwasicki |
4f4b42d
to
2a37fa2
Compare
@@ -302,14 +302,18 @@ jobs: | |||
if: github.event_name != 'push' | |||
runs-on: ubuntu-20.04 | |||
steps: | |||
- name: Setup Git | |||
uses: frequenz-floss/[email protected] | |||
# TODO(cookiecutter): Uncomment this for projects with private dependencies |
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.
Any disadvantage if we just always set this?
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.
I just am very paranoid about passing around credentials where they are not really needed. 🤷
Oh, damn, this doesn't work if credentials are not passed because |
Credentials were not being passed to the docker build process, and the installation test runs as part of the image builting, so it fails when some `pip` dependency needs git credentials to be fetched. This commit fixes this by passing the `.git-credentials` file generated by the `frequenz-floss/gh-action-setup-git` action to the docker build process. Even when the produced docker image doesn't leave the GitHub runner, this is not ideal because we are storing credentials in the docker image, so eventually this job should be changed so the tests is done in a running container instead of a docker image building process, but for now is a good-enough workaround. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
We'll remove the TODOs in the next commit. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
ping @Marenz |
setup-git-user
step withgh-action-setup-git
gh-action-setup-git
step to every job doing a checkouttest-installation
jobFixes #278.