Merge pull request #159 from VisLab/main #54
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 schemas | |
on: | |
push: | |
branches: ["*"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
process-changed-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v41 | |
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g | |
# with: | |
# since_last_remote_commit: true | |
- name: List all changed files | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
for file in "$ALL_CHANGED_FILES"; do | |
echo "$file was changed" | |
done | |
- name: Install dependencies | |
run: pip install git+https://github.com/hed-standard/hed-python.git@develop | |
- name: Run command on file list | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
python tests/validate_schemas.py $ALL_CHANGED_FILES |