Skip to content

Commit

Permalink
Improve html reports
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Dec 19, 2023
1 parent 0806ecf commit 75f6c8f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
13 changes: 8 additions & 5 deletions .github/actions/deploy-tests-report/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ inputs:
target:
required: true
description: 'Directory and filename to upload reports to'
git-ref:
reference:
required: true
description: 'Git ref to use for the commit'
commit-url:
description: 'Title reference'
reference-link:
required: true
description: 'Github commit url'
description: 'Title reference link'
input:
required: true
description: 'File to read the report from'
Expand All @@ -20,7 +20,10 @@ runs:
- name: Generate HTML report
shell: bash
run: |
echo "<h3 class='title'><a href=\"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\">${{ github.run_id }} ($(date '+%Y-%m-%d %H:%M'))</a></h3>" > report-file.html
echo "<h3 class='title'>" > report-file.html
echo "<a href=\"${{ inputs.reference-link }}\">${{ inputs.reference }}</a>" >> report-file.html
echo "(<a href=\"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\">${{ github.run_id }} ($(date '+%Y-%m-%d %H:%M'))</a>)" >> report-file.html
echo "</h3>" >> report-file.html
echo "<p class='info'>Reference: <a href=\"${{ inputs.commit-url }}\">${{ inputs.git-ref }}</a></p>" >> report-file.html
echo "<br>" >> report-file.html
sed 's/$/<br>/' ${{ inputs.input }} >> report-file.html
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/langchain-master-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:
uses: ./.github/actions/deploy-tests-report
with:
target: "reports/tests/langchain.html"
git-ref: "${{ steps.commit-ref.outputs.commit-ref }}"
commit-url: "https://github.com/langchain-ai/langchain/commits/${{ steps.commit-ref.outputs.commit-ref }}"
reference: "${{ steps.commit-ref.outputs.commit-ref }}"
reference-link: "https://github.com/langchain-ai/langchain/commits/${{ steps.commit-ref.outputs.commit-ref }}"
input: "ragstack-e2e-tests/langchain-tests-report.txt"

- name: Cleanup AstraDB
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/llamaindex-main-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:
uses: ./.github/actions/deploy-tests-report
with:
target: "reports/tests/llamaindex.html"
git-ref: "${{ steps.commit-ref.outputs.commit-ref }}"
commit-url: "https://github.com/run-llama/llama_index/commits/${{ steps.commit-ref.outputs.commit-ref }}"
reference: "${{ steps.commit-ref.outputs.commit-ref }}"
reference-link: "https://github.com/run-llama/llama_index/commits/${{ steps.commit-ref.outputs.commit-ref }}"
input: "ragstack-e2e-tests/llamaindex-tests-report.txt"

- name: Cleanup AstraDB
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ragstack-ai-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ jobs:
if: always()
id: ragstack-ai-version
run: |
echo "ragstack-ai-version=$(poetry run python -c 'from importlib.metadata import version; print(version("ragstack-ai"))')" >> $GITHUB_OUTPUT
set +x
(tox run -c ragstack-e2e-tests -e get-package-version -q -- ragstack-ai) | head -n 1 > /tmp/ragstack-ai-version
cat /tmp/ragstack-ai-version
echo "ragstack-ai-version=$(cat /tmp/ragstack-ai-version)" >> $GITHUB_OUTPUT
- name: Prepare report for Slack
if: always()
Expand All @@ -97,8 +100,8 @@ jobs:
uses: ./.github/actions/deploy-tests-report
with:
target: "reports/tests/ragstack-ai/latest-release.html"
git-ref: "${{ steps.ragstack-ai-version.outputs.ragstack-ai-version }}"
commit-url: "https://pypi.org/project/ragstack-ai/${{ steps.ragstack-ai-version.outputs.ragstack-ai-version }}/"
reference: "${{ steps.ragstack-ai-version.outputs.ragstack-ai-version }}"
reference-link: "https://pypi.org/project/ragstack-ai/${{ steps.ragstack-ai-version.outputs.ragstack-ai-version }}/"
input: "ragstack-e2e-tests/all-tests-report.txt"

- name: Cleanup AstraDB
Expand Down
7 changes: 7 additions & 0 deletions ragstack-e2e-tests/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ deps =
commands =
black .
ruff --fix .

[testenv:get-package-version]
description = get package version
deps =
poetry
commands =
poetry run python -c 'from importlib.metadata import version; print(version("{posargs:ragstack-ai}"))'

0 comments on commit 75f6c8f

Please sign in to comment.