From 9079cd8e6e9718bd98aff36245f5d3930ac4b41d Mon Sep 17 00:00:00 2001 From: Olaf Mersmann Date: Mon, 12 Oct 2026 14:43:44 +0200 Subject: [PATCH] ci: Validate problems.yaml against the schema on every pull request The old New Problem Check workflow only ran when triggered manually and used utils/validate_yaml.py, which still expects the old list-based format and fails on the current problems.yaml. Replace it with a check that runs opl validate on every pull request and push to main. --- .github/workflows/new_problem_check.yml | 14 +++++------- .github/workflows/validate_problems.yml | 30 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/validate_problems.yml diff --git a/.github/workflows/new_problem_check.yml b/.github/workflows/new_problem_check.yml index 12773e1..ab24270 100644 --- a/.github/workflows/new_problem_check.yml +++ b/.github/workflows/new_problem_check.yml @@ -15,17 +15,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v7 - - name: Set up Python - uses: actions/setup-python@v6 + - name: Install uv + uses: astral-sh/setup-uv@v10.3.2 with: - python-version: '3.x' + python-version: 3.14 - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r utils/requirements.txt + run: uv sync --dev - name: Run New Problem Check - run: | - uv run utils/validate_yaml.py problems.yaml - + run: uv run utils/validate_yaml.py problems.yaml diff --git a/.github/workflows/validate_problems.yml b/.github/workflows/validate_problems.yml new file mode 100644 index 0000000..52e698e --- /dev/null +++ b/.github/workflows/validate_problems.yml @@ -0,0 +1,30 @@ +name: Validate problems.yaml + +on: + push: + branches: ["main"] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + python-version: "3.10" + + - name: Install the project + run: uv sync + + - name: Validate problems.yaml against the schema + run: uv run opl validate problems.yaml