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

fix: localcheckout mock #1198

Merged
merged 11 commits into from
Jun 20, 2022
Merged

fix: localcheckout mock #1198

merged 11 commits into from
Jun 20, 2022

Conversation

ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Jun 5, 2022

Merging this before a fix for #1193 was merged, renders local actions unusable ( Merged, this change is ready )

  • Do not skip any checkouts if we don't bind mount the workspace
  • --no-skip-localcheckout now feels named wrong, since skipping is replaced by mocking it with docker cp
  • You can now checkout your workspace to multiple different locations and not just to the first one
  • Evaluate the path property of localcheckout

Closes #1112

Replaces other PR's
Closes #1192

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2022

MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ CREDENTIALS secretlint yes no 1.0s
✅ EDITORCONFIG editorconfig-checker 2 0 0.02s
✅ GIT git_diff yes no 0.0s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@ChristopherHX ChristopherHX changed the title localcheckout mock fix: localcheckout mock Jun 5, 2022
@jsoref
Copy link
Contributor

jsoref commented Jun 7, 2022

So, I'm currently playing w/ this in https://github.com/check-spelling/cacti and I noticed:

jsoref@jsoref-mbp cacti % ~/code/nektos/act/dist/local/act  -W .github/workflows/spelling.yml --container-architecture linux/arm64
[Check Spelling/Check Spelling] 🚀  Start image=catthehacker/ubuntu:act-latest
[Check Spelling/Check Spelling]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform=linux/arm64 username= forcePull=false
[Check Spelling/Check Spelling]   🐳  docker create image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Check Spelling/Check Spelling]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Check Spelling/Check Spelling]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Check Spelling/Check Spelling]   ☁  git clone 'https://github.com/check-spelling/check-spelling' # ref=prerelease
[Check Spelling/Check Spelling] ⭐ Run Pre check-spelling
[Check Spelling/Check Spelling]   ☁  git clone 'https://github.com/check-spelling/checkout-merge' # ref=v0.0.0
[Check Spelling/Check Spelling] ⭐ Run Pre checkout-merge
[Check Spelling/Check Spelling]   ✅  Success - Pre checkout-merge
[Check Spelling/Check Spelling]   ☁  git clone 'https://github.com/actions/download-artifact' # ref=v3
[Check Spelling/Check Spelling]   ☁  git clone 'https://github.com/actions/upload-artifact' # ref=v3
[Check Spelling/Check Spelling]   ✅  Success - Pre check-spelling
[Check Spelling/Check Spelling] ⭐ Run Main check-spelling
[Check Spelling/Check Spelling]   🐳  docker cp src=/Users/jsoref/.cache/act/check-spelling-check-spelling@prerelease/ dst=/var/run/act/actions/check-spelling-check-spelling@prerelease/
[Check Spelling/Check Spelling]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/check-spelling-check-spelling@prerelease/] user= workdir=
[Check Spelling/Check Spelling] close /var/folders/r3/n29fz25x72x191fdv6mhhr3m0000gp/T/act2613583022: file already closed
[Check Spelling/Check Spelling] ⭐ Run Main checkout
[Check Spelling/Check Spelling]   🐳  docker cp src=/Users/jsoref/code/cacti/. dst=/Users/jsoref/code/cacti/${{ inputs.experimental_path }}
[Check Spelling/Check Spelling]   🐳  docker exec cmd=[mkdir -p /Users/jsoref/code/cacti/${{ inputs.experimental_path }}] user= workdir=
[Check Spelling/Check Spelling] close /var/folders/r3/n29fz25x72x191fdv6mhhr3m0000gp/T/act3496818503: file already closed
[Check Spelling/Check Spelling]   ✅  Success - Main checkout
[Check Spelling/Check Spelling] ⭐ Run Main check-spelling
[Check Spelling/Check Spelling]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/spelling.sh] user= workdir=
[Check Spelling/Check Spelling]   ❓  ::add-matcher::/var/run/act/actions/check-spelling-check-spelling@prerelease/reporter.json
| Retrieving expect from .github/actions/spelling/expect.txt
| Retrieving excludes from .github/actions/spelling/excludes.txt
| Downloaded https://raw.githubusercontent.com/check-spelling/check-spelling/dictionary-20200211/dict.txt (to /var/run/act/actions/check-spelling-check-spelling@prerelease/words)
| (...Extra dictionaries...)
| (...Check extra dictionaries...)
| Retrieving allow from .github/actions/spelling/allow.txt
| Retrieving reject from .github/actions/spelling/reject.txt
| Retrieving line_forbidden from .github/actions/spelling/line_forbidden.patterns
| Retrieving patterns from .github/actions/spelling/patterns.txt
| Retrieving advice from .github/actions/spelling/advice.md
| Checking spelling...
| (...Spell check files...)
| Checking 412 files
| (...Spell check...)
^Z
zsh: suspended  ~/code/nektos/act/dist/local/act -W .github/workflows/spelling.yml  

Specifically:

[Check Spelling/Check Spelling] 🐳 docker cp src=/Users/jsoref/code/cacti/. dst=/Users/jsoref/code/cacti/${{ inputs.experimental_path }}
[Check Spelling/Check Spelling] 🐳 docker exec cmd=[mkdir -p /Users/jsoref/code/cacti/${{ inputs.experimental_path }}] user= workdir=

It's possible this belongs to something else, but ...

@ChristopherHX
Copy link
Contributor Author

Sounds like you also want to be able to use expressions in this mock ( step.With["path"] )...

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #1198 (e330e73) into master (4f8da0a) will increase coverage by 4.46%.
The diff coverage is 76.10%.

@@            Coverage Diff             @@
##           master    #1198      +/-   ##
==========================================
+ Coverage   57.50%   61.97%   +4.46%     
==========================================
  Files          32       40       +8     
  Lines        4594     5404     +810     
==========================================
+ Hits         2642     3349     +707     
- Misses       1729     1786      +57     
- Partials      223      269      +46     
Impacted Files Coverage Δ
pkg/model/action.go 0.00% <0.00%> (ø)
pkg/model/step_result.go 0.00% <ø> (ø)
pkg/model/workflow.go 54.29% <0.00%> (+3.38%) ⬆️
pkg/container/docker_run.go 15.18% <21.73%> (+9.64%) ⬆️
pkg/container/docker_pull.go 33.33% <33.33%> (ø)
pkg/container/file_collector.go 42.05% <42.05%> (ø)
pkg/common/git/git.go 50.00% <47.91%> (ø)
pkg/container/docker_auth.go 47.61% <50.00%> (+2.61%) ⬆️
pkg/exprparser/interpreter.go 73.37% <53.48%> (-0.02%) ⬇️
pkg/model/planner.go 50.73% <60.00%> (+0.32%) ⬆️
... and 30 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@ChristopherHX ChristopherHX marked this pull request as ready for review June 8, 2022 16:00
@ChristopherHX ChristopherHX requested a review from a team as a code owner June 8, 2022 16:00
@mergify
Copy link
Contributor

mergify bot commented Jun 17, 2022

@ChristopherHX this pull request is now in conflict 😩

@mergify mergify bot added the conflict PR has conflicts label Jun 17, 2022
@mergify mergify bot removed the conflict PR has conflicts label Jun 17, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 17, 2022

@ChristopherHX this pull request has failed checks 🛠

@mergify mergify bot added the needs-work Extra attention is needed label Jun 17, 2022
@mergify mergify bot removed the needs-work Extra attention is needed label Jun 17, 2022
Copy link
Member

@KnisterPeter KnisterPeter left a comment

Choose a reason for hiding this comment

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

👍
This is way better than skipping in the first place

@cplee cplee merged commit c3fb686 into master Jun 20, 2022
@cplee cplee deleted the ChristopherHX-localcheckout-mock branch June 20, 2022 22:14
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.

Issue: act not checking out in composite actions
4 participants