Skip to content

Commit 04868b0

Browse files
authored
chore: check packaging before uv sync and add Check Complete job for branch protection (langgenius#2470)
* chore: check packaging before uv sync * chore: remove predicate * chore: create no test job for pass * Revert "chore: create no test job for pass" This reverts commit 4069a01. * chore: add a stable job for branch protection * chore: avoid blank matrix warning
1 parent 07adfdc commit 04868b0

1 file changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/pre-pr-check-per-plugin.yaml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
if [ ${#VALID_PLUGINS[@]} -eq 0 ]; then
4949
echo "has_changes=false" >> $GITHUB_OUTPUT
50-
echo "plugins=[]" >> $GITHUB_OUTPUT
50+
echo "plugins=[\"__no_changes__\"]" >> $GITHUB_OUTPUT
5151
else
5252
JSON=$(printf '%s\n' "${VALID_PLUGINS[@]}" | jq -R . | jq -s -c .)
5353
echo "has_changes=true" >> $GITHUB_OUTPUT
@@ -143,6 +143,10 @@ jobs:
143143
exit 1
144144
fi
145145
146+
- name: Check Packaging
147+
run: |
148+
uv run --with requests --with dify_plugin python .scripts/uploader/upload-package.py -d "${{ matrix.plugin_path }}" -t "${{ secrets.MARKETPLACE_TOKEN }}" --plugin-daemon-path /home/linuxbrew/.linuxbrew/bin/dify -u "${{ secrets.MARKETPLACE_BASE_URL }}" -f --test
149+
146150
- name: Validate Dependencies with uv
147151
run: |
148152
cd "${{ matrix.plugin_path }}"
@@ -155,10 +159,6 @@ jobs:
155159
export SERVERLESS_HOST=0.0.0.0
156160
uv run --project "${{ matrix.plugin_path }}" --with requests python .scripts/validator/test-plugin-install.py -d "${{ matrix.plugin_path }}"
157161
158-
- name: Check Packaging
159-
run: |
160-
uv run --with requests --with dify_plugin python .scripts/uploader/upload-package.py -d "${{ matrix.plugin_path }}" -t "${{ secrets.MARKETPLACE_TOKEN }}" --plugin-daemon-path /home/linuxbrew/.linuxbrew/bin/dify -u "${{ secrets.MARKETPLACE_BASE_URL }}" -f --test
161-
162162
- name: Package plugin
163163
run: |
164164
SAFE_NAME=$(echo "${{ matrix.plugin_path }}" | tr '/' '-')
@@ -196,3 +196,31 @@ jobs:
196196
working-directory: ${{ env.EXTRACT_DIR }}
197197
run: |
198198
PLUGIN_FILE_PATH="$(realpath ../${{ env.PKG_NAME }})" uv run --with pytest pytest
199+
200+
check-complete:
201+
name: Check Complete
202+
needs:
203+
- detect-changes
204+
- test
205+
if: always()
206+
runs-on: ubuntu-latest
207+
steps:
208+
- name: Verify check results
209+
run: |
210+
if [ "${{ needs.detect-changes.result }}" != "success" ]; then
211+
echo "detect-changes failed."
212+
exit 1
213+
fi
214+
215+
if [ "${{ needs.detect-changes.outputs.has_changes }}" != "true" ]; then
216+
echo "No plugin changes detected."
217+
exit 0
218+
fi
219+
220+
if [ "${{ needs.test.result }}" = "success" ]; then
221+
echo "Plugin checks passed."
222+
exit 0
223+
fi
224+
225+
echo "Plugin checks failed."
226+
exit 1

0 commit comments

Comments
 (0)