chore: Update code review prompt for current nushell repo #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: This workflow runs tests for hustcer/deepseek-review. | |
# REF: | |
# - https://github.com/vyadh/nutest/blob/main/.github/workflows/tests.yaml | |
# - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables | |
name: Run Tests | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- develop | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
schedule: | |
- cron: '0 0 * * *' # Run every morning at 0am UTC | |
permissions: | |
contents: read | |
jobs: | |
run-tests: | |
name: Run Tests | |
permissions: | |
checks: write | |
pull-requests: write | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ['*', nightly] # Earliest supported, latest and nightly | |
platform: [ubuntu-latest, windows-latest, macos-latest, ubuntu-22.04-arm] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout Nutest Repo | |
uses: actions/checkout@v4 | |
with: | |
ref: v1.0.1 | |
path: nutest | |
repository: vyadh/nutest | |
sparse-checkout: nutest/ | |
- name: Setup Nu | |
uses: hustcer/setup-nu@v3 | |
with: | |
version: ${{ matrix.version }} | |
- name: Test DeepSeek Review | |
shell: nu {0} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
use ${{ github.workspace }}/nutest/nutest | |
use ${{ github.workspace }}/nu/review.nu [prepare-awk] | |
prepare-awk | |
( | |
nutest run-tests | |
--fail | |
--display terminal | |
--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 filename = 'test-summary.json' | |
let gist_id = 'b99391ee59016b17d0befe3331387e89' | |
let data = { | |
files: { | |
"test-summary.json": { | |
content: (open --raw $filename) | |
} | |
} | |
} | |
( | |
$data | http patch | |
--redirect-mode 'follow' | |
--content-type 'application/json' | |
--headers { | |
'X-GitHub-Api-Version': '2022-11-28' | |
'Accept': 'application/vnd.github+json' | |
'Authorization': $'Bearer ${{ secrets.GH_PAT }}' | |
} | |
$'https://api.github.com/gists/($gist_id)' | |
) | ignore |