昨日、GitHub Actions で大きなアップデートがありました。
actions/upload-artifact において、 zip じゃなくてもアップロードできるようになって
artifact の URL をダウンロードすることなく、ブラウザで直接開けるようになりました。
一方で、この機能は難点があり、このブログを書いた時点では、1ファイルしかアップロードできません。
そのため、それを解決するために、foolhtml という雑なツールを作りました。
まずは、GitHub Actions のアップデートと組み合わせたときのデモを見てください。

PRのコメントから html を開くだけで、複数のファイルがCIのレポートとして読み取れるようになりました。
入力のディレクトリにあるファイルをすべて 1枚の html にまとめて、html 1枚でビューアのような状態を作っています。
表示部分はほぼAIが書きました。
デモで使ったGitHub Actions のサンプルはこんな感じです。github actions も用意しているので使ってみてください。
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: wreulicke/foolhtml@master with: output: /tmp/output.html inputs: | path/to/file1.html path/to/dir/ - uses: actions/upload-artifact@v7 id: upload-artifact with: name: ci-report archive: false # actions/upload-artifact のアップデートで追加された path: /tmp/output.html - uses: actions/github-script@v6 if: github.event_name == 'pull_request' env: ARTIFACT_URL: ${{ steps.upload-artifact.outputs.artifact-url }} with: script: | const artifactUrl = process.env.ARTIFACT_URL; const commentBody = `You can see [ci-reports](${artifactUrl}) here.`; await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: commentBody, });
なお、CircleCIでは、複数のファイルのアップロードが出来て普通に開けるので、こんなことは考えなくても良いのでたまにCircleCIが恋しくなります。
CircleCI の test analysis の機能とかも好きでした。
終わり。
ツールのリポジトリはここです。