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

Pass dockerfile to build executor #1606

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

artificial-aidan
Copy link
Contributor

@artificial-aidan artificial-aidan commented Feb 3, 2023

This allows testing actions with non standard dockerfile names

This PR is required for the tests I added. The tests also cover my previous relative dockerfile PR changes. Once that PR is in I can update the test workflows to use the normal test repo.

Signed-off-by: Aidan Jensen aidan@artificial.com

Commit Message

{{title}} (#1606)

This allows testing actions with non standard dockerfile names

Signed-off-by: Aidan Jensen aidan@artificial.com

This allows testing actions with non standard dockerfile names

Signed-off-by: Aidan Jensen <aidan@artificial.com>
@artificial-aidan artificial-aidan requested a review from a team as a code owner February 3, 2023 15:38
@@ -50,7 +50,8 @@ func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor {
if input.Container != nil {
buildContext, err = input.Container.GetContainerArchive(ctx, input.ContextDir+"/.")
} else {
buildContext, err = createBuildContext(ctx, input.ContextDir, "Dockerfile")
buildContext, err = createBuildContext(ctx, input.ContextDir, input.Dockerfile)
options.Dockerfile = input.Dockerfile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only set it here because I wasn't sure what the expectation was when the input.Container was not nil. It would seem cleaner to set it in the above block, but I was worried about changing existing behavior.

Copy link
Contributor

@ChristopherHX ChristopherHX Feb 3, 2023

Choose a reason for hiding this comment

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

input.Container = local action, build context not present outside of the docker container.

Please move it out of the if condition.

Assumes the dockerfile is read from the buildcontext.

@@ -11,3 +11,5 @@ jobs:
- uses: './actions-environment-and-context-tests/docker'
- uses: 'nektos/act-test-actions/js@main'
- uses: 'nektos/act-test-actions/docker@main'
- uses: 'artificial-aidan/act-test-actions/docker-file@6e10d41bbdb0919d19847350a7763a580cfa41c8'
- uses: 'artificial-aidan/act-test-actions/docker-relative-context/action@6e10d41bbdb0919d19847350a7763a580cfa41c8'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This action tests my previous PR

@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #1606 (c618030) into master (4989f44) will increase coverage by 0.65%.
The diff coverage is 75.63%.

@@            Coverage Diff             @@
##           master    #1606      +/-   ##
==========================================
+ Coverage   61.22%   61.87%   +0.65%     
==========================================
  Files          46       46              
  Lines        7141     7248     +107     
==========================================
+ Hits         4372     4485     +113     
+ Misses       2462     2459       -3     
+ Partials      307      304       -3     
Impacted Files Coverage Δ
pkg/container/docker_cli.go 82.23% <ø> (ø)
pkg/container/docker_logger.go 52.08% <ø> (ø)
pkg/container/docker_pull.go 33.33% <ø> (ø)
pkg/container/docker_run.go 13.58% <ø> (ø)
pkg/container/docker_volume.go 0.00% <ø> (ø)
pkg/container/docker_images.go 27.02% <29.41%> (-4.13%) ⬇️
pkg/model/github_context.go 61.06% <32.00%> (-19.40%) ⬇️
pkg/container/docker_auth.go 51.35% <56.25%> (+3.73%) ⬆️
pkg/runner/runner.go 86.45% <66.66%> (-2.05%) ⬇️
pkg/runner/step.go 83.33% <75.00%> (+0.36%) ⬆️
... and 18 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Aidan Jensen <aidan@artificial.com>
@mergify mergify bot merged commit 44333c7 into nektos:master Feb 8, 2023
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.

3 participants