diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 265cc8a..3b2fee1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,3 +70,29 @@ jobs: --report { type: junit, path: test-report.xml } --returns summary | to json | save --force test-summary.json ) + + - name: Publish Test Summary + if: runner.os == 'macOS' && matrix.version == '*' && github.ref == 'refs/heads/main' + shell: nu {0} + run: | + let gist_id = 'b99391ee59016b17d0befe3331387e89' + let filename = 'test-summary.json' + + let data = { + files: { + "test-summary.json": { + content: (open --raw $filename) + } + } + } + ( + $data | http patch + --redirect-mode 'follow' + --content-type 'application/json' + --headers { + 'Authorization': $'Bearer ${{ secrets.GITHUB_TOKEN }}' + 'Accept': 'application/vnd.github+json' + 'X-GitHub-Api-Version': '2022-11-28' + } + $'https://api.github.com/gists/($gist_id)' + ) | ignore diff --git a/nu/review.nu b/nu/review.nu index d234087..41f99ab 100644 --- a/nu/review.nu +++ b/nu/review.nu @@ -26,7 +26,10 @@ # - Local PR Review: just cr -r hustcer/deepseek-review -n 32 use kv.nu * -use common.nu [ECODE, hr-line, is-installed, git-check, has-ref, compare-ver, compact-record, windows?, mac?] +use common.nu [ + ECODE, hr-line, is-installed, windows?, mac?, + compare-ver, compact-record, git-check, has-ref, +] const RESPONSE_END = 'data: [DONE]' diff --git a/tests/test-review.nu b/tests/test-review.nu index 78446a2..f980511 100644 --- a/tests/test-review.nu +++ b/tests/test-review.nu @@ -1,7 +1,10 @@ use std/assert -use ../nu/review.nu [is-safe-git, generate-include-regex, generate-exclude-regex, prepare-awk, get-diff] +use ../nu/review.nu [ + get-diff, is-safe-git, prepare-awk, + generate-include-regex, generate-exclude-regex, +] # Get the unicode width of the input string def get-uw [] { $in | str stats | get unicode-width }