Skip to content

fix: fill missing and correct obsolete EC numbers #23

fix: fill missing and correct obsolete EC numbers

fix: fill missing and correct obsolete EC numbers #23

Workflow file for this run

name: Run QC tests
on: [pull_request]
jobs:
qc-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python 3
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: pip install git+https://github.com/Devlin-Moyer/macaw.git@main numpy==1.26.4
- name: Run MACAW tests
run: python code/test/macawTests.py | tee "$RUNNER_TEMP/macaw_summary.txt"
- name: Mass and charge balance report
continue-on-error: true
run: python code/test/balanceTest.py | tee "$RUNNER_TEMP/balance_summary.txt"
- name: Combine test summaries
id: qc-run
run: |
{
echo "#### MACAW: dead-end and duplicate tests"
echo ""
echo '```'
cat "$RUNNER_TEMP/macaw_summary.txt"
echo '```'
echo ""
echo "#### Mass and charge balance"
echo ""
echo '```'
if [ -s "$RUNNER_TEMP/balance_summary.txt" ]; then
cat "$RUNNER_TEMP/balance_summary.txt"
else
echo "(balance report unavailable)"
fi
echo '```'
} > data/testResults/qc_summary.md
# Pass the combined Markdown summary through as a multiline step output so
# it renders as sections in the PR comment.
{
echo "results<<QC_EOF"
cat data/testResults/qc_summary.md
echo "QC_EOF"
} >> "$GITHUB_OUTPUT"
- name: Mention PR# in README.md
env:
PR_NUMBER: ${{ github.event.number }}
run: sed -i -e "s/[[:digit:]]\{3,4\}\*\* (QC)/$PR_NUMBER\*\* (QC)/" data/testResults/README.md
- name: Update local branch before committing changes
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
git stash
git fetch
git checkout $BRANCH_NAME
if git stash list | grep -q 'stash@{'; then
git stash pop
fi
- name: Auto-commit results
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_user_name: memote-bot
# [skip ci] so this results commit does not re-trigger the workflows.
commit_message: "chore: add QC test results [skip ci]"
file_pattern: data/testResults/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
- name: Post comment
uses: NejcZdovc/comment-pr@v2
with:
file: "commentQC.md"
identifier: "GITHUB_COMMENT_QC"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
TEST_RESULTS: ${{steps.qc-run.outputs.results}}
GH_ACTION_URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}