Skip to content

Add build-docs job to main github actions file#8504

Merged
jonkoops merged 12 commits intoLeaflet:mainfrom
exequiel09:jekyll-github-actions-check-#8502
Oct 2, 2022
Merged

Add build-docs job to main github actions file#8504
jonkoops merged 12 commits intoLeaflet:mainfrom
exequiel09:jekyll-github-actions-check-#8502

Conversation

@exequiel09
Copy link
Copy Markdown
Contributor

Closes #8502

Copy link
Copy Markdown
Collaborator

@jonkoops jonkoops 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 a welcome change. Great work! I just have one small comment.

Comment thread .github/workflows/main.yml Outdated
@jonkoops jonkoops added the workflow Anything related to Leaflet development process and tools label Oct 1, 2022
Co-authored-by: Jon Koops <jonkoops@gmail.com>
@exequiel09 exequiel09 requested a review from jonkoops October 1, 2022 13:57
Copy link
Copy Markdown
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

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

Sorry for the additional review comments, but looks like we can optimize things a bit.

Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml
Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml
@exequiel09 exequiel09 requested a review from jonkoops October 1, 2022 14:33
@mourner
Copy link
Copy Markdown
Member

mourner commented Oct 1, 2022

@exequiel09 it's now failing with a surprising error about not being able to build some internal example for some reason...

Comment thread docs/Gemfile Outdated
@mourner
Copy link
Copy Markdown
Member

mourner commented Oct 1, 2022

@exequiel09 looks like jekyll is available, but it still shows that error...

@exequiel09
Copy link
Copy Markdown
Contributor Author

exequiel09 commented Oct 1, 2022

Maybe related to this. still reading docs: https://jekyllrb.com/docs/troubleshooting/#configuration-problems

@exequiel09 exequiel09 requested review from jonkoops and mourner and removed request for jonkoops and mourner October 1, 2022 17:32
@exequiel09
Copy link
Copy Markdown
Contributor Author

It's really hard debugging this pipeline issue 😅

@exequiel09
Copy link
Copy Markdown
Contributor Author

Finally! It worked https://github.com/Leaflet/Leaflet/actions/runs/3165492356/jobs/5154569243 🎊

Copy link
Copy Markdown
Member

@Falke-Design Falke-Design left a comment

Choose a reason for hiding this comment

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

The building works but it doesn't break when the error happens:

https://github.com/Falke-Design/Leaflet/actions/runs/3165535999/jobs/5154637242

Comment thread docs/_config.yml
@@ -1,4 +1,4 @@
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE]
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, vendor/bundle, vendor/cache, vendor/gems, vendor/ruby]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just thinking out loud here, perhaps it would be better to use an include rather than to list all the things that should be excluded?

Copy link
Copy Markdown
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

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

Code changes look good to me, but I am interested why it doesn't fail the job as expected when an error is introduced as @Falke-Design mentioned.

@jonkoops
Copy link
Copy Markdown
Collaborator

jonkoops commented Oct 1, 2022

It's really hard debugging this pipeline issue 😅

Yeah, debugging stuff on Github Actions can be a bit of a hassle. I usually test on my own fork as well, less waiting on upstream capacity.

@exequiel09
Copy link
Copy Markdown
Contributor Author

oh. I didn't know that I can run GH actions on a fork 😲

@exequiel09
Copy link
Copy Markdown
Contributor Author

exequiel09 commented Oct 1, 2022

I usually test on my own fork as well, less waiting on upstream capacity.

Not sure on how to run on my own fork. Quick search landed me on the event pull_request_target: https://dev.to/github/running-github-actions-on-forks-4e75

@exequiel09
Copy link
Copy Markdown
Contributor Author

exequiel09 commented Oct 1, 2022

Screen Shot 2022-10-02 at 2 27 21 AM

Okay so running locally, somehow error is swallowed. Running echo $? after the failed command yield exit status of 0 which it shouldn't be.

@exequiel09
Copy link
Copy Markdown
Contributor Author

bundle exec executes a command in the context of the bundle (from bundle exec --help ).
If you pass a executable name that is not found, e.g. bundle exec thisisnotwhatyouarelookingfor, it will exit with a status code != 0.

https://stackoverflow.com/a/64785111

I think I need to do some digging further to bubble up the error

@Falke-Design
Copy link
Copy Markdown
Member

Can we store the output on a file and check if it contains Error?

@Falke-Design
Copy link
Copy Markdown
Member

Found a repo: https://github.com/epstechtheatre/Jekyll-Tester

@exequiel09
Copy link
Copy Markdown
Contributor Author

exequiel09 commented Oct 1, 2022

Found a repo: https://github.com/epstechtheatre/Jekyll-Tester

Pushed commit to use the suggestion action 6edc829

Comment thread .github/workflows/main.yml Outdated
@exequiel09
Copy link
Copy Markdown
Contributor Author

@exequiel09
Copy link
Copy Markdown
Contributor Author

Okay so it's not related to bundler but with jekyll: jekyll/jekyll#8367

@exequiel09
Copy link
Copy Markdown
Contributor Author

Okay I know the fix. Pushing another one. removing the suggested action as well

@exequiel09
Copy link
Copy Markdown
Contributor Author

Added --strict_front_matter.

https://stackoverflow.com/a/68600279

@exequiel09
Copy link
Copy Markdown
Contributor Author

Screen Shot 2022-10-02 at 3 16 28 AM

Adding --strict_front_matter will make exit status be 1

@Falke-Design Falke-Design requested a review from jonkoops October 1, 2022 19:33
Copy link
Copy Markdown
Member

@Falke-Design Falke-Design left a comment

Choose a reason for hiding this comment

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

I have no idea how the workflows are working but the output looks good now 😄

Copy link
Copy Markdown
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

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

Workflow is looking good to me, got a couple small questions but after that I think we can merge.

Comment thread docs/_config.yml
@@ -1,4 +1,4 @@
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE]
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, vendor/bundle, vendor/cache, vendor/gems, vendor/ruby]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we really need anything from the vendor directory? Perhaps we can exclude all of it?

Suggested change
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, vendor/bundle, vendor/cache, vendor/gems, vendor/ruby]
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, vendor]

Copy link
Copy Markdown
Contributor Author

@exequiel09 exequiel09 Oct 2, 2022

Choose a reason for hiding this comment

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

I'm not sure on the proper solution but the jekyll website suggested that fix on CI issue #8504 (comment)

There maybe folders that jekyll team don't want to ignore hence they added a blacklist of it

Copy link
Copy Markdown
Contributor Author

@exequiel09 exequiel09 Oct 2, 2022

Choose a reason for hiding this comment

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

Mentioned in jekyll website:

The proper solution is to incorporate the default setting for exclude: rather than override it completely:
For versions up to v3.4.3, the exclude: setting must look like following:

exclude:
  - Gemfile
  - Gemfile.lock
  - node_modules
  - vendor/bundle/
  - vendor/cache/
  - vendor/gems/
  - vendor/ruby/
  - any_additional_item # any user-specific listing goes at the end

Comment thread docs/Gemfile Outdated
@exequiel09
Copy link
Copy Markdown
Contributor Author

I have no idea how the workflows are working but the output looks good now 😄

@Falke-Design we need the build to command to return non-zero exit status to make GitHub actions check fail. In that case jekyll build returns 1 when there are errors and 0 if there's none.

Copy link
Copy Markdown
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Copy Markdown
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

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

Looking good to me!

@jonkoops
Copy link
Copy Markdown
Collaborator

jonkoops commented Oct 2, 2022

Thank you so much for this contribution @exequiel09. This change helps us out a lot!

@jonkoops jonkoops merged commit f3d8a05 into Leaflet:main Oct 2, 2022
@exequiel09 exequiel09 deleted the jekyll-github-actions-check-#8502 branch October 2, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workflow Anything related to Leaflet development process and tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a check to our CI to make errors in jekyll visible

4 participants