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

Allow writing index.html, data.js without pushing to gh-pages #85

Open
MingweiSamuel opened this issue Oct 29, 2021 · 8 comments
Open

Comments

@MingweiSamuel
Copy link

MingweiSamuel commented Oct 29, 2021

On our gh-pages branch we have a few different things, docs, other benchmarks, etc, and I want finer-grain control over how things are pushed to the branch. I think it makes sense to have an option that outputs these assets (edit: i.e. as html+js files, in a particular directory, without uploading them to git) to the user to let them do what they want with them.

@pancetta
Copy link

pancetta commented Sep 6, 2022

Second that. I struggle to get the html and js file out of the action without any commits, pushes fetches etc. Any plans to make this work? It looks like removing the call to writeBenchmark here might already help, but my fork doesn't work (which is because I have absolutely no experience with writing reusable. public GitHub Actions). Any help is appreciated!

@brainstorm
Copy link

"(...) an option that outputs these assets to the user to let them do what they want with them."

What do you mean by this? Can you be more specific?

@pancetta
Copy link

pancetta commented Jan 5, 2023

I guess having these files as artifacts would be great. Then users can decide what to do with them and where and when. Does that make sense?

@robertbastian
Copy link

I'd like to see this extended to inputs as well. HTML generation should not required Git at all:

  • instead of git checkout gh-pages, the user can put the existing index.html, data.js in the working directory
    • we for example fetch them from cloud storage, but need to keep an empty branch around because the action requires a branch to read from and commit to
  • the action updates them with the new results
  • instead of git commit -m "benchmark result for ..." the user can decide what happens with the updated files
    • i.e. we want to upload to cloud storage

@MingweiSamuel
Copy link
Author

MingweiSamuel commented Feb 15, 2023

I actually was able to work around this issue, I don't remember exactly how it works:

https://github.com/hydro-project/hydroflow/blob/9d17b4d5da37efcde633a87cf489541cb5371555/.github/workflows/ci.yml#L289-L302

Convert the json into a js file

echo 'window.BENCHMARK_DATA = ' | cat - "$WWW_DIR/bench/data.json" > "$WWW_DIR/bench/data.js"

Just to write the DEFAULT_INDEX_HTML into index.html (the .ts file actually has no typescript)

node --input-type=module -e "$(curl -sSL https://raw.githubusercontent.com/benchmark-action/github-action-benchmark/master/src/default_index_html.ts) console.log(DEFAULT_INDEX_HTML)" > "$WWW_DIR/bench/index.html"

@latonz
Copy link

latonz commented Apr 9, 2024

Why not store these files as job artifacts? Other actions (e.g. code-coverage-report-action) do it like this and it works quite well.

@robertbastian
Copy link

I believe workflows cannot access artifacts from previous runs.

@latonz
Copy link

latonz commented Apr 10, 2024

AFAIK this works with code-coverage-report-action via the GH REST API.

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

5 participants