From 8ac319363607641f1ef37e42e838d84a25aeef47 Mon Sep 17 00:00:00 2001 From: Da Shen Date: Wed, 25 Nov 2026 00:33:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[1407]=20ci:=20=E5=90=88=E5=B9=B6=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=8F=92=E4=BB=B6=E6=B5=8B=E8=AF=95=E5=B9=B6=E6=8C=89?= =?UTF-8?q?=E9=9C=80=E8=BF=90=E8=A1=8C=20AI=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-debian.yml | 56 ++++++++++++----- .github/workflows/test-plugins-debian.yml | 74 +++++++++++++++++++++++ 2 files changed, 115 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/test-plugins-debian.yml diff --git a/.github/workflows/test-debian.yml b/.github/workflows/test-debian.yml index 6003d744..75a78428 100644 --- a/.github/workflows/test-debian.yml +++ b/.github/workflows/test-debian.yml @@ -14,11 +14,8 @@ on: - 'agent/**' - 'code/**' - 'extensions/**' - - 'review/**' - - 'simplify/**' - 'tests/**' - 'tui/**' - - 'web-search/**' - 'gfproject.json' - '.github/workflows/test-debian.yml' pull_request: @@ -27,11 +24,8 @@ on: - 'agent/**' - 'code/**' - 'extensions/**' - - 'review/**' - - 'simplify/**' - 'tests/**' - 'tui/**' - - 'web-search/**' - 'gfproject.json' - '.github/workflows/test-debian.yml' @@ -39,22 +33,54 @@ 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","tui","tests"]' + + if [ "$EVENT_NAME" = "workflow_dispatch" ]; then + domains='["ai","agent","code","tui","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","tui","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: - - ai - - agent - - code - - review - - simplify - - tui - - web-search - - tests + domain: ${{ fromJSON(needs.changes.outputs.domains) }} name: test (${{ matrix.domain }}) steps: - name: Install dependencies diff --git a/.github/workflows/test-plugins-debian.yml b/.github/workflows/test-plugins-debian.yml new file mode 100644 index 00000000..6fe5f406 --- /dev/null +++ b/.github/workflows/test-plugins-debian.yml @@ -0,0 +1,74 @@ +name: Test built-in plugins on Debian trixie + +# 内置插件共用一个 CI job,依次运行各自测试。 +# 安装最新的 Goldfish,与主测试 workflow 保持一致。 + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - 'ai/**' + - 'agent/**' + - 'code/**' + - 'extensions/**' + - 'review/**' + - 'simplify/**' + - 'tests/**' + - 'web-search/**' + - 'gfproject.json' + - '.github/workflows/test-plugins-debian.yml' + pull_request: + paths: + - 'ai/**' + - 'agent/**' + - 'code/**' + - 'extensions/**' + - 'review/**' + - 'simplify/**' + - 'tests/**' + - 'web-search/**' + - 'gfproject.json' + - '.github/workflows/test-plugins-debian.yml' + +env: + DEBIAN_FRONTEND: noninteractive + +jobs: + plugins: + container: debian:trixie + runs-on: ubuntu-latest + timeout-minutes: 30 + 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: Test review plugin + run: gf test review/tests/liii + + - name: Test simplify plugin + run: gf test simplify/tests/liii + + - name: Test web-search plugin + run: gf test web-search/tests/liii From 5ee3f61c584aca5682eef0e4ef2ab550ff7ce594 Mon Sep 17 00:00:00 2001 From: Da Shen Date: Wed, 25 Nov 2026 00:37:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[1407]=20ci:=20=E4=BF=AE=E6=AD=A3=E9=A1=B6?= =?UTF-8?q?=E5=B1=82=E6=B5=8B=E8=AF=95=E7=9B=AE=E5=BD=95=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-debian.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-debian.yml b/.github/workflows/test-debian.yml index 75a78428..31cb0ee9 100644 --- a/.github/workflows/test-debian.yml +++ b/.github/workflows/test-debian.yml @@ -108,4 +108,9 @@ jobs: gf version - name: Run tests - run: gf test ${{ matrix.domain }}/tests/liii + run: | + if [ "${{ matrix.domain }}" = "tests" ]; then + gf test tests/liii + else + gf test ${{ matrix.domain }}/tests/liii + fi