Skip to content

Commit 2901a34

Browse files
committed
add workflow concurrency input
1 parent 63c827a commit 2901a34

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/validate-plugin-smoke.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- "plugins.json"
77
- "scripts/validate_plugins/**"
88
- ".github/workflows/validate-plugin-smoke.yml"
9+
schedule:
10+
- cron: "0 2 * * *"
911
workflow_dispatch:
1012
inputs:
1113
plugin_names:
@@ -20,6 +22,10 @@ on:
2022
description: "AstrBot git ref to validate against"
2123
required: false
2224
default: "master"
25+
max_workers:
26+
description: "Maximum concurrent plugin validations"
27+
required: false
28+
default: "8"
2329

2430
jobs:
2531
validate-plugin-smoke:
@@ -37,7 +43,18 @@ jobs:
3743
echo "ASTRBOT_REF=${{ inputs.astrbot_ref }}" >> "$GITHUB_ENV"
3844
echo "PLUGIN_NAME_LIST=${{ inputs.plugin_names }}" >> "$GITHUB_ENV"
3945
echo "PLUGIN_LIMIT=${{ inputs.plugin_limit }}" >> "$GITHUB_ENV"
46+
echo "MAX_WORKERS=${{ inputs.max_workers }}" >> "$GITHUB_ENV"
47+
echo "SHOULD_VALIDATE=true" >> "$GITHUB_ENV"
48+
49+
- name: Set scheduled validation inputs
50+
if: github.event_name == 'schedule'
51+
run: |
52+
echo "ASTRBOT_REF=master" >> "$GITHUB_ENV"
53+
echo "PLUGIN_NAME_LIST=" >> "$GITHUB_ENV"
54+
echo "PLUGIN_LIMIT=" >> "$GITHUB_ENV"
55+
echo "MAX_WORKERS=8" >> "$GITHUB_ENV"
4056
echo "SHOULD_VALIDATE=true" >> "$GITHUB_ENV"
57+
echo "VALIDATION_NOTE=Running scheduled full plugin validation." >> "$GITHUB_ENV"
4158
4259
- name: Detect changed plugins from pull request
4360
if: github.event_name == 'pull_request'
@@ -86,6 +103,10 @@ jobs:
86103
args+=(--limit "$PLUGIN_LIMIT")
87104
fi
88105
106+
if [ -n "${MAX_WORKERS:-}" ]; then
107+
args+=(--max-workers "$MAX_WORKERS")
108+
fi
109+
89110
python scripts/validate_plugins/run.py "${args[@]}"
90111
91112
- name: Upload validation report

0 commit comments

Comments
 (0)