mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2026-07-30 09:56:10 +00:00
feat: validate YAML gha
This commit is contained in:
parent
40ac5f8c16
commit
9b3a517b7a
65
.github/workflows/validate-yamls.yml
vendored
Normal file
65
.github/workflows/validate-yamls.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
name: Validate YAML Workflows
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'yaml_instance/**/*.yaml'
|
||||||
|
- '.github/workflows/**/*.yml'
|
||||||
|
- 'tools/validate_all_yamls.py'
|
||||||
|
- 'check/**/*.py'
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'yaml_instance/**/*.yaml'
|
||||||
|
- '.github/workflows/**/*.yml'
|
||||||
|
- 'tools/validate_all_yamls.py'
|
||||||
|
- 'check/**/*.py'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate:
|
||||||
|
name: Validate YAML Configuration Files
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python 3.12
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v4
|
||||||
|
with:
|
||||||
|
enable-cache: true
|
||||||
|
|
||||||
|
- name: Cache uv dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
.venv
|
||||||
|
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-uv-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: uv sync
|
||||||
|
|
||||||
|
- name: Run YAML validation
|
||||||
|
run: uv run python tools/validate_all_yamls.py
|
||||||
|
|
||||||
|
- name: Report validation results
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "All YAML workflow files passed validation"
|
||||||
|
else
|
||||||
|
echo "YAML validation failed - check the logs above for details"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user