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

Use unique name for reusable workflows #2015

Merged
merged 9 commits into from
Nov 12, 2023
Merged

Use unique name for reusable workflows #2015

merged 9 commits into from
Nov 12, 2023

Conversation

Andy4495
Copy link
Contributor

Use unique name for reusable workflows.

Fixes #2003 - act does not create separate containers for matrix builds with reusable workflows.

@Andy4495 Andy4495 requested a review from a team as a code owner September 21, 2023 04:11
@Andy4495
Copy link
Contributor Author

Here is an example of the change that my pull request will make. When running act -j call-reusable-workflow on my repo Andy4495/act-workflow-test:

With act v0.2.50. Note that all four matrix jobs have the same name:

...
[call-reusable-workflow/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[call-reusable-workflow/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[call-reusable-workflow/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[call-reusable-workflow/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
...

With this pull request. Note the unique digit added to each iteration of call-reusable-workflow:

...
[call-reusable-workflow-3/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[call-reusable-workflow-4/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[call-reusable-workflow-2/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[call-reusable-workflow-1/reusable-workflow/reusable-workflow] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
...

@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Merging #2015 (d30dcab) into master (4989f44) will increase coverage by 0.19%.
Report is 266 commits behind head on master.
The diff coverage is 59.45%.

@@            Coverage Diff             @@
##           master    #2015      +/-   ##
==========================================
+ Coverage   61.22%   61.41%   +0.19%     
==========================================
  Files          46       53       +7     
  Lines        7141     8779    +1638     
==========================================
+ Hits         4372     5392    +1020     
- Misses       2462     2957     +495     
- Partials      307      430     +123     
Files Coverage Δ
pkg/common/executor.go 51.69% <100.00%> (+1.69%) ⬆️
pkg/container/docker_cli.go 82.23% <ø> (ø)
pkg/container/docker_logger.go 52.08% <ø> (ø)
pkg/runner/step_action_local.go 93.54% <100.00%> (ø)
pkg/runner/step_action_remote.go 91.56% <100.00%> (+0.65%) ⬆️
pkg/runner/step_docker.go 93.18% <100.00%> (ø)
pkg/container/file_collector.go 39.68% <0.00%> (+2.38%) ⬆️
pkg/container/util.go 0.00% <0.00%> (ø)
pkg/container/docker_build.go 60.00% <80.00%> (+1.02%) ⬆️
...ontainer/linux_container_environment_extensions.go 23.07% <0.00%> (-1.25%) ⬇️
... and 31 more

... and 2 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@@ -64,7 +64,7 @@ func (rc *RunContext) String() string {
if rc.caller != nil {
// prefix the reusable workflow with the caller job
// this is required to create unique container names
name = fmt.Sprintf("%s/%s", rc.caller.runContext.Run.JobID, name)
name = fmt.Sprintf("%s/%s", rc.caller.runContext.Name, name)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's still not unique (e.g. matrix?), but should have less conflicts

@mergify mergify bot merged commit 1c16fd1 into nektos:master Nov 12, 2023
10 checks passed
jmikedupont2 pushed a commit to meta-introspector/act that referenced this pull request Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

act does not create separate containers for matrix builds with reusable workflows
3 participants