Update tests.yml #131
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
# This workflow will validate the mzQC example files against the JSON schema. | |
name: tests | |
env: | |
# folder path only; file name and extension wild cards get added in-use | |
PATH_TO_EXAMPLES: ./specification_documents/examples | |
on: | |
push: | |
branches: [ main, ci_test_validate ] | |
pull_request: | |
branches: [ main, ci_test_validate ] | |
schedule: | |
- cron: "0 0 1 1/1 *" # Run monthly. | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install jsonschema check-jsonschema pymzqc click | |
- name: Syntactic Validatation of Example mzQC Files | |
run: | | |
for i in $PATH_TO_EXAMPLES/*.mz[qQ][cC]; do | |
echo "Syntactic Validation of $i" | |
#jsonschema -i $i ./schema/mzqc_schema.json | |
check-jsonschema --schemafile ./schema/mzqc_schema.json $i | |
if [ $? -ne 0 ]; then | |
echo "Failed to validate $i" | |
exit 1 | |
fi | |
done | |
- name: Semantic Validatation of Example mzQC Files | |
run: | | |
for i in $PATH_TO_EXAMPLES/*.mz[qQ][cC]; do | |
echo "Semantic Validation of $i" | |
mzqc_offline_validator.py $i | |
if [ $? -ne 0 ]; then | |
echo "Failed to validate $i" | |
exit 1 | |
fi | |
done |