Repository navigation
[1403] 移除 simplify 插件,web-search 与 code-review 统一至 gfcode 命名空间 #150
This file contains hidden or 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
| name: Test on Debian trixie | |
| # 测试 CI:只跑单元测试(gf test 各 domain 的 tests), | |
| # 不执行格式化与代码度量检查(静态检查在 check-debian.yml 中独立运行)。 | |
| # 与 liii 固定 GOLDFISH_VERSION 不同,这里通过 releases/latest API 取最新 tag, | |
| # 始终用最新发布的 Goldfish(参考 liii/cd-debian13.yml 的取最新版做法)。 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'ai/**' | |
| - 'agent/**' | |
| - 'code/**' | |
| - 'tests/**' | |
| - 'app/**' | |
| - 'gfproject.json' | |
| - '.github/workflows/test-debian.yml' | |
| pull_request: | |
| paths: | |
| - 'ai/**' | |
| - 'agent/**' | |
| - 'code/**' | |
| - 'tests/**' | |
| - 'app/**' | |
| - 'gfproject.json' | |
| - '.github/workflows/test-debian.yml' | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| domains: ${{ steps.domains.outputs.value }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Select test domains | |
| id: domains | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| BEFORE_SHA: ${{ github.event.before }} | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA: ${{ github.sha }} | |
| run: | | |
| domains='["agent","code","app","tests"]' | |
| if [ "$EVENT_NAME" = "workflow_dispatch" ]; then | |
| domains='["ai","agent","code","app","tests"]' | |
| else | |
| if [ "$EVENT_NAME" = "pull_request" ]; then | |
| base_sha="$BASE_SHA" | |
| elif [ -n "$BEFORE_SHA" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then | |
| base_sha="$BEFORE_SHA" | |
| else | |
| base_sha="$HEAD_SHA^" | |
| fi | |
| if git diff --name-only "$base_sha" "$HEAD_SHA" -- ai/ | grep -q .; then | |
| domains='["ai","agent","code","app","tests"]' | |
| fi | |
| fi | |
| echo "Test domains: $domains" | |
| echo "value=$domains" >> "$GITHUB_OUTPUT" | |
| test: | |
| needs: changes | |
| container: debian:trixie | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| domain: ${{ fromJSON(needs.changes.outputs.domains) }} | |
| name: test (${{ matrix.domain }}) | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y git curl ca-certificates python3 | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: git add safe directory | |
| run: git config --global --add safe.directory '*' | |
| - name: Install Goldfish (latest) | |
| run: | | |
| TAG=$(curl -fsSL -H "User-Agent: gfcode-ci" \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| https://api.github.com/repos/MoganLab/goldfish/releases/latest \ | |
| | python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'])") | |
| echo "Latest goldfish release: $TAG" | |
| curl -fsSL -o /tmp/goldfish.deb \ | |
| "https://github.com/MoganLab/goldfish/releases/download/$TAG/goldfish-scheme-x86_64-$TAG.deb" | |
| apt-get install -y /tmp/goldfish.deb | |
| gf version | |
| - name: Run tests | |
| run: | | |
| if [ "${{ matrix.domain }}" = "tests" ]; then | |
| gf test tests/liii | |
| else | |
| gf test ${{ matrix.domain }}/tests/liii | |
| fi |