Skip to content

DATASTD-2489 Reduce The Size For StudentAssessment Sample Data #48

DATASTD-2489 Reduce The Size For StudentAssessment Sample Data

DATASTD-2489 Reduce The Size For StudentAssessment Sample Data #48

Workflow file for this run

# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: XML Validation
on:
pull_request:
branches:
- v6.0.0
paths:
- '**/*.xml'
- '**/*.xsd'
permissions:
contents: read
pull-requests: write
jobs:
validate-xml:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./eng
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Poetry
run: pipx install poetry
- name: Set up Python 3.12
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
cache: "poetry"
- name: Install dependencies
run: poetry env use "3.12" && poetry install
- name: Run XML validation
id: validation
run: |
# Validate the samples directory
poetry run python validate_xml.py
# save exit code to a variable
exit_code=$?
# validate the Descriptors directory
poetry run python validate_xml.py --samples-dir Descriptors
# echo the combined exit code
exit_code=$((exit_code + $?))
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
exit $exit_code
- name: Comment on PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
if: always()
with:
script: |
const exitCode = "${{ steps.validation.outputs.exit_code }}";
let commentBody;
if (exitCode === "0") {
commentBody = `## ✅ XML Validation Passed
All XML files have been validated successfully against their schemas and descriptor definitions.`;
} else {
commentBody = `## ❌ XML Validation Failed
XML validation found errors. Please review and fix the issues listed in the build log.
### Error Format
Errors are formatted as: \`[file name]\t[line number]\t[validation error]\`
### Next Steps
1. Review the validation errors above
2. Fix the XML schema validation errors and/or descriptor reference errors
3. Push your changes to trigger validation again`;
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});