mirror of
https://github.com/hustcer/deepseek-review.git
synced 2026-05-13 05:16:05 +08:00
99 lines
2.6 KiB
YAML
99 lines
2.6 KiB
YAML
# Description: This workflow runs tests for hustcer/deepseek-review.
|
|
# REF:
|
|
# - https://github.com/vyadh/nutest/blob/main/.github/workflows/tests.yaml
|
|
|
|
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 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
|