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 caching in the github actions #1255

Closed
bschmalhofer opened this issue Sep 23, 2021 · 8 comments
Closed

Use caching in the github actions #1255

bschmalhofer opened this issue Sep 23, 2021 · 8 comments
Assignees
Milestone

Comments

@bschmalhofer
Copy link
Contributor

Here is another idea. When looking at https://github.com/RotherOSS/otobo/runs/3684898399?check_suite_focus=true we see that there is one step that takes most of the time. That's installing the CPAN dependencies from cpanfile.docker. This could be eliminated by using a dedicated Docker image with all the dependencies installed. A better idea might be to simply cache the CPAN dependencies. Either the directory with the installed Perl modules, or the .cpanm workdir.

Originally posted by @bschmalhofer in https://github.com/RotherOSS/CodePolicy/issues/51#issuecomment-925749171

bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
Mostly for checking whether ./github/workflows/code_policy.yml catches the errors
bschmalhofer added a commit that referenced this issue Sep 23, 2021
But still not tidy. Should be reported by code_policy.yml
bschmalhofer added a commit that referenced this issue Sep 23, 2021
Install fewer Debian packages, improve caching.
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
Did not bother to investige the configuration problems of XML::XSLT
bschmalhofer added a commit that referenced this issue Sep 23, 2021
@bschmalhofer bschmalhofer self-assigned this Sep 23, 2021
@bschmalhofer bschmalhofer added this to the OTOBO 10.1.1 milestone Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 23, 2021

It is not clear whether this works as expected. There are several cases to be checked:

  • action on push: cache is used when pushing to the same branch
  • action on pull_request: cache is used when rerunning the job
  • action on pull_request, no cache in parent branch: cache is not used on the next PR
  • action on pull_request, with cache in parent branch: cache is used on the next PR

bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 23, 2021
bschmalhofer added a commit that referenced this issue Sep 24, 2021
bschmalhofer added a commit that referenced this issue Sep 24, 2021
bschmalhofer added a commit that referenced this issue Sep 24, 2021
bschmalhofer added a commit that referenced this issue Sep 24, 2021
No longer use hashfile() as that gives a different SHA.
bschmalhofer added a commit that referenced this issue Sep 24, 2021
Issue #1255: use the REST interface for SHA
bschmalhofer added a commit that referenced this issue Sep 24, 2021
Mainly for testing the github actions.
bschmalhofer added a commit that referenced this issue Sep 24, 2021
@bschmalhofer
Copy link
Contributor Author

Another optimisation in cache_local_lib.yml. For getting a checksum on cpanfile.docker, we don't need a complete checkout of the branch. We can ask Github directly via the REST interface. Unfortunately the SHA from the webservice is not the same value as returned by hashfiles(). This can be redeemed by using git rev-parse :cpanfile.docker in the other workflows.

Still not closing, in case problems crop up.

@bschmalhofer
Copy link
Contributor Author

After discussion with @svenoe and consulting #1110 we deciding to merge the two check actions.

bschmalhofer added a commit that referenced this issue Sep 28, 2021
Issue #1255: merge syntax_check.yml into code_policy.yml
@bschmalhofer
Copy link
Contributor Author

Looks good. Only the code_policy.yml workflow is now executed. This workflow contains the syntax check.

@bschmalhofer
Copy link
Contributor Author

This seems to work without hassle. Let's use it for rel-10_0 as well.

@bschmalhofer
Copy link
Contributor Author

Another idea for a speedup. Install Code::TidyAll and dependencies via cpanm. This should make the installation of Debian packages faster.

@bschmalhofer
Copy link
Contributor Author

Closing this issue. Any problems that pop up should be fixed in #1278.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant