Skip to content

Commit

Permalink
Enable protein.sh test in github actions (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkollasch authored Jan 21, 2023
2 parents 2c854cb + 6d64d36 commit 18c9e55
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 3 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/end_to_end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: end-to-end run

# Controls when the action will run.
on:
# # Triggers the workflow on push or pull request events but only for the master branch
# # don't trigger on push
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
name: "test ${{ matrix.job.target }} (${{ matrix.job.os }})"
runs-on: "${{ matrix.job.os }}"

strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-apple-darwin , os: macos-latest }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-latest, use-cross: true }

steps:
- name: Checkout source code
uses: "actions/checkout@v3"
with:
submodules: 'recursive'

- name: Install prerequisites
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
case ${{ matrix.job.target }} in
*-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install libomp-dev ;;
*-apple-darwin) brew install gcc libomp; ;;
esac
- name: Compile default
run: |
case ${{ matrix.job.target }} in
*-unknown-linux-*) make all ;;
*-apple-darwin) make all-mac ;;
esac
- name: Compile multicore
run: |
case ${{ matrix.job.target }} in
*-unknown-linux-*) make all-openmp ;;
*-apple-darwin) make all-mac-openmp ;;
esac
- name: Run end-to-end test
run: |
pwd
cd tests
bash protein.sh
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
name: "run_tests ${{ matrix.job.target }} (${{ matrix.job.os }})"
name: "compile ${{ matrix.job.target }} (${{ matrix.job.os }})"
runs-on: "${{ matrix.job.os }}"

strategy:
Expand Down
12 changes: 10 additions & 2 deletions tests/protein.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ tmpfile2="$(mktemp /tmp/evcouplings.XXXXXX)"
echo "$tmpfile2"
../bin/plmc -c "$tmpfile" --save-weights "$tmpfile2" -le 16.0 -lh 0.01 -m 100 -g -f DYR_ECOLI ../example/protein/DHFR.a2m

# Compare couplings lines except for last decimal digit
comp_value=0
diff --brief "$tmpfile" DHFR.couplings || comp_value=$?
diff --brief -L "$tmpfile" -L DHFR.couplings \
<(while IFS= read -r line; do echo "${line%?}"; done < "$tmpfile") \
<(while IFS= read -r line; do echo "${line%?}"; done < DHFR.couplings) ||
comp_value=$?

weights_comp=0
diff --brief "$tmpfile2" DHFR_weights_raw.txt || weights_comp=$?
Expand Down Expand Up @@ -41,8 +45,12 @@ tmpfile="$(mktemp /tmp/evcouplings.XXXXXX)"
tmpfile2="$(mktemp /tmp/evcouplings.XXXXXX)"
../bin/plmc -c "$tmpfile" -le 16.0 -lh 0.01 -m 100 -g -f DYR_ECOLI -w DHFR_weights_raw.txt --save-weights "$tmpfile2" ../example/protein/DHFR.a2m

# Compare couplings lines except for last decimal digit
comp_value=0
diff --brief "$tmpfile" DHFR.couplings || comp_value=$?
diff --brief -L "$tmpfile" -L DHFR.couplings \
<(while IFS= read -r line; do echo "${line%?}"; done < "$tmpfile") \
<(while IFS= read -r line; do echo "${line%?}"; done < DHFR.couplings) ||
comp_value=$?

weights_comp=0
diff --brief "$tmpfile2" DHFR_weights_raw.txt || weights_comp=$?
Expand Down

0 comments on commit 18c9e55

Please sign in to comment.