From dc065418886655a9b925d7c8fd1772a5365741d8 Mon Sep 17 00:00:00 2001 From: Camila Maia Date: Wed, 6 Nov 2024 18:18:04 -0300 Subject: [PATCH] Wokflow para validar materials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Também renomeando workflow de deploy --- .github/workflows/{fly.yml => deploy.yml} | 0 .github/workflows/validate_materials.yml | 27 +++++++++++++++++++++++ curadoria_coletiva/validate_materials.py | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) rename .github/workflows/{fly.yml => deploy.yml} (100%) create mode 100644 .github/workflows/validate_materials.yml diff --git a/.github/workflows/fly.yml b/.github/workflows/deploy.yml similarity index 100% rename from .github/workflows/fly.yml rename to .github/workflows/deploy.yml diff --git a/.github/workflows/validate_materials.yml b/.github/workflows/validate_materials.yml new file mode 100644 index 0000000..b90ff95 --- /dev/null +++ b/.github/workflows/validate_materials.yml @@ -0,0 +1,27 @@ +name: Validate Materials + +on: + push: + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run validation script + run: | + export PYTHONPATH=$(pwd) # Adiciona o diretório raiz ao PYTHONPATH + python curadoria_coletiva/validate_materials.py diff --git a/curadoria_coletiva/validate_materials.py b/curadoria_coletiva/validate_materials.py index b75eaaa..d7299d7 100644 --- a/curadoria_coletiva/validate_materials.py +++ b/curadoria_coletiva/validate_materials.py @@ -69,6 +69,6 @@ def _validate_material(material_data: Dict[str, Any], unique_titles: Set[str]) - if __name__ == "__main__": - input_yaml_file = "all_materials.yml" - collect_materials("materials", input_yaml_file) + input_yaml_file = "curadoria_coletiva/all_materials.yml" + collect_materials("curadoria_coletiva/materials", input_yaml_file) validate_materials_from_yaml(input_yaml_file)