Skip to content

Commit

Permalink
github workflow corrected.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBrownlee committed Oct 25, 2024
1 parent 077b617 commit 4da6290
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ jobs:
pytest
- name: Compare to moh_v3_template.csv
shell: bash {0}
# Script based largely on update_moh_template.sh
run: |
python src/clinical_etl/generate_schema.py --out tmp_template
diff tmp_template.csv moh_v3_template.csv > tests/moh_diffs.txt
rm tmp_template.csv
bytes=$(head -5 tests/moh_diffs.txt | wc -c)
dd if=tests/moh_diffs.txt bs="$bytes" skip=1 conv=notrunc of=tests/moh_diffs1.txt
diff tests/moh_diffs1.txt tests/moh_diffs.txt
# Script based largely on update_moh_template.sh
python src/clinical_etl/generate_schema.py --out moh_template
diff moh_template.csv moh_v3_template.csv > curr_diff.txt
bytes=$(head -5 curr_diff.txt | wc -c)
dd if=curr_diff.txt bs="$bytes" skip=1 conv=notrunc of=new_diff.txt
diff new_diff.txt tests/moh_diffs.txt
if [[ $? == 1 ]]; then echo MoH template checking needs to be updated! See https://github.com/CanDIG/clinical_ETL_code#mapping-template for information.
exit 1
fi
13 changes: 7 additions & 6 deletions update_moh_template.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash
# Updates the moh_template based on the schema.
# Manual differences are recorded in tests/moh_diffs.txt


python src/clinical_etl/generate_schema.py --out tmp_template
diff tmp_template.csv moh_v3_template.csv > tests/moh_diffs.txt
rm tmp_template.csv
bytes=$(head -5 tests/moh_diffs.txt | wc -c)
dd if=tests/moh_diffs.txt bs="$bytes" skip=1 conv=notrunc of=tests/moh_diffs1.txt
python src/clinical_etl/generate_schema.py --out moh_template
diff moh_template.csv moh_v3_template.csv > curr_diff.txt
bytes=$(head -5 curr_diff.txt | wc -c)
dd if=curr_diff.txt bs="$bytes" skip=1 conv=notrunc of=tests/moh_diffs1.txt
mv tests/moh_diffs1.txt tests/moh_diffs.txt
rm curr_diff.txt

0 comments on commit 4da6290

Please sign in to comment.