nexusformat / definitions

Definitions of the NeXus Standard File Structure and Contents
https://manual.nexusformat.org/
Other
26 stars 56 forks source link

CI fails when making the CNAME file #1154

Closed woutdenolf closed 2 years ago

woutdenolf commented 2 years ago

https://github.com/nexusformat/definitions/runs/7137146695?check_suite_focus=true

woutdenolf commented 2 years ago

@prjemian Is CI still not building the documentation as it is done locally?

prjemian commented 2 years ago

In my local build (make local):

(bluesky_2022_3) prjemian@zap:~/.../NeXus/definitions$ ls ./build/manual/build/html/CNAME
./build/manual/build/html/CNAME
prjemian commented 2 years ago

That was for the dev_tools branch., Checking with main branch now.

prjemian commented 2 years ago

On main branch, with make local:

(bluesky_2022_3) prjemian@zap:~/.../NeXus/definitions$ ls ./build/manual/build/html/CNAME
ls: cannot access './build/manual/build/html/CNAME': No such file or directory
prjemian commented 2 years ago

The CNAME is created https://github.com/nexusformat/definitions/blob/1ac17ef55af511113458699889691d28052a8d58/.github/workflows/publish-sphinx.yml#L79-L81

and then the build/manual/build directory is re-written by https://github.com/nexusformat/definitions/blob/1ac17ef55af511113458699889691d28052a8d58/.github/workflows/publish-sphinx.yml#L83-L87

This second step deletes the CNAME file, correct?

prjemian commented 2 years ago

Also note the default branch of sphinx-notes/pages Actions is v2.

woutdenolf commented 2 years ago

I think we should add a job that builds the html, copies the CNAME file to the resulting folder and then Build (html) and Commit. The last one build the html again I guess but should start from the already existing build.

prjemian commented 2 years ago

Right. Our publishing steps might be too complicated for sphinx-notes/pages.

woutdenolf commented 2 years ago

Yes, so the point is that CNAME needs to be added to the result of an HTML build. In other words it needs to be copied afterward the sphinx HTML build.

woutdenolf commented 2 years ago

I have two potential fixes: https://github.com/nexusformat/definitions/pull/1158 and https://github.com/nexusformat/definitions/pull/1157

woutdenolf commented 2 years ago

Of course we need to run the publishing CI to check which one works. I propose to merge #1158 first and wait for CI.

prjemian commented 2 years ago

Either that or suspend the rules, temporarily. This time, merge.

woutdenolf commented 2 years ago

Ok so https://github.com/nexusformat/definitions/pull/1158 doesn't work, probably because sphinx-notes/pages is not building in the normal directory. I see this

The HTML pages are in ../../../../../tmp/pages-gVzbCR6Kc2.

But I'm not sure the build is actually done in there are the build is just copied there.

prjemian commented 2 years ago

After sphinx-notes/pages runs its part, which branch is the CI process now? If it has switched to gh-pages this step could be easier.

woutdenolf commented 2 years ago

Maybe https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path is also an option. I'll investigate ...

prjemian commented 2 years ago

From the workflow log, steps 198-201

Setting up git repository
  Setting up git configure
  No local changes to save
  Setting up branch gh-pages
  Branch exists, checkout to it
  Switched to a new branch 'gh-pages'
  branch 'gh-pages' set up to track 'origin/gh-pages'.
  Removing build/
  Removing utils/
 Committing HTML documentation
  Deleting all file in repository
  removed 'CNAME'
prjemian commented 2 years ago

From raw logs:

2022-06-30T19:11:10.8519755Z removed 'utilities.html'
2022-06-30T19:11:10.8519991Z removed 'validation.html'
2022-06-30T19:11:10.8520229Z Copying HTML documentation to repository
2022-06-30T19:11:10.8520826Z '/tmp/pages-oW788h6erK/./.doctrees/applying-nexus.doctree' -> '././.doctrees/applying-nexus.doctree'
2022-06-30T19:11:10.8521367Z '/tmp/pages-oW788h6erK/./.doctrees/authorgroup.doctree' -> '././.doctrees/authorgroup.doctree'

...

2022-06-30T19:11:10.9211990Z '/tmp/pages-oW788h6erK/./_static/sphinxdoc.css' -> '././_static/sphinxdoc.css'
2022-06-30T19:11:10.9212227Z '/tmp/pages-oW788h6erK/./_static/navigation.png' -> '././_static/navigation.png'
2022-06-30T19:11:10.9212484Z '/tmp/pages-oW788h6erK/./_static/nxdl_vocabulary.html' -> '././_static/nxdl_vocabulary.html'
2022-06-30T19:11:10.9212830Z '/tmp/pages-oW788h6erK/./_static/NeXusIntern.pdf' -> '././_static/NeXusIntern.pdf'
2022-06-30T19:11:10.9213087Z '/tmp/pages-oW788h6erK/./_static/nxdl_vocabulary.yml' -> '././_static/nxdl_vocabulary.yml'

So instead of

echo manual.nexusformat.org > ./build/manual/build/html/CNAME

then perhaps this will work:

echo manual.nexusformat.org > ./CNAME
woutdenolf commented 2 years ago

html_extra_path works locally (PR #1159) so hopefully CI will like it as well.

prjemian commented 2 years ago

I see this line in the raw workflow logs:

2022-06-30T19:38:14.3785167Z '/tmp/pages-baY42JJDDi/./CNAME' -> '././CNAME'
woutdenolf commented 2 years ago

Indeed. Seems ok now:

https://github.com/nexusformat/definitions/runs/7138369879?check_suite_focus=true

woutdenolf commented 2 years ago

I will do the same on the dev_tools branch.