Create ID0093.yaml #52
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |