Skip to content

Create ID0093.yaml

Create ID0093.yaml #51

name: validate_resources
on:
pull_request:
branches:
- main
paths:
- 'resources/curated/**'
jobs:
validate_resources:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-variant: Mambaforge
channels: conda-forge
python-version: '3.11'
activate-environment: motbxtools_min
environment-file: envs/motbxtools_min.yml
use-mamba: true
- name: Activate conda environment and install local motbxtools Python library
run: |
conda activate motbxtools_min
python -m pip install -e .
- name: Get changed resource files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files_yaml: |
resources:
- resources/curated/**
- name: Execute Python script to populate keywords and validate resource
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.resources_all_changed_files }}
run: |
for file in ALL_CHANGED_FILES; do
python src/motbxtools/utils/populate_resource_keywords.py "$file"
python src/motbxtools/utils/validate_resource.py "$file"
done