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

Is it possible to reduce the pull time for : Pull wagoid/commitlint-github-action:1.6.0 #37

Closed
srinadhkch opened this issue Jun 29, 2020 · 4 comments

Comments

@srinadhkch
Copy link

Hello there,
I am new to git actions. Please correct me if I am stating anything wrong.

In Git actions -> jobs, I noticed that Pull wagoid/commitlint-github-action:1.6.0 step is taking
31 sec.

Is there any way to reduce this time.

Please have a look on this issue.

Thank you

@wagoid
Copy link
Owner

wagoid commented Jun 29, 2020

hi @kaychess!

Back when I created this action this was the fastest option available (i.e. pull the action's image from docker hub).

At that time I tried to use an alpine-node image to make the pull quicker but I had an issue that I couldn't get the hang of it so I just kept with the default node image from docker hub. I'll have a look if I can get the alpine-node version working again.

Also, it seems that now that Github Actions is more evolved there are options that'll probably be better than the current one. I'll also have a look at that.

Will get back to you once I have some improvements done 🚀

wagoid added a commit that referenced this issue Jul 3, 2020
The action's image is now based on alpine, which reduced drastically it's size. The previous compressed size was ~352 MB, now it's only ~56 MB.

Resolves #37
@wagoid wagoid closed this as completed in d0b8181 Jul 3, 2020
@wagoid
Copy link
Owner

wagoid commented Jul 3, 2020

Hey @kaychess, I've just published version 1.7.0 which uses the alpine based image. The image's compressed size was reduced from ~352 MB to ~56 MB, which made the pull time get reduced to around ~12s as you can see In this workflow run 🎉 🚀

I also tried to use GitHub's package registry instead of docker hub for further improvement to the pull time. Turns out their registry can't be used to host actions' source code yet because they don't allow pulling images (even public ones) without authenticating. Once they add support for that I'll add this update too 💪

@srinadhkch
Copy link
Author

Oh Thank you very much for the update :)
Meanwhile when I was playing with commit lint, I figured that we can use plain git actions without any docker.
All we need to do is just get the last git commit message and pipe it to the commitlint for validation. Of-couse we need to install respective commitlint node module. But installing it using git actions, we can use caching [I know we can but I dont know how yet], by which I long run should bring the time factor to around 4 to 5 sec.

name: Lint
on:
  push:
    branches:
      - master
jobs:
  git_commit_messages_lint:
    name: Git_commit_messages_lint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 12
      - name: Get Last committed message and check against commit lint
        run: git log -1 --pretty=%B | npx commitlint
      - name: Check if there is any error
        if: failure()
        run: |
          echo " : Error ::: Lint : Git Commit Messages "
          exit 1
      .... Other steps ...

@wagoid
Copy link
Owner

wagoid commented Jul 5, 2020

Yep, definitely! Actions and workflows can be built without docker as well. The reason why this action was made with docker was so it could already include the dependencies without configuring the node environment.

You'll definitely get some seconds in the speed by running a similar code without docker 😃

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

2 participants