From 1808f0957c0894ecc184edf601ec97c43ce0c50e Mon Sep 17 00:00:00 2001 From: Aaron Kollasch Date: Fri, 20 Jan 2023 18:02:59 -0500 Subject: [PATCH 1/3] Reduce protein.sh test precision Don't check last decimal digit of couplings output --- tests/protein.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 tests/protein.sh diff --git a/tests/protein.sh b/tests/protein.sh old mode 100644 new mode 100755 index eead404..d607b9f --- a/tests/protein.sh +++ b/tests/protein.sh @@ -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=$? @@ -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=$? From 6d3f6fd2bea78fcf1a9c4bf715cb55ab15851f82 Mon Sep 17 00:00:00 2001 From: Aaron Kollasch Date: Fri, 20 Jan 2023 18:03:38 -0500 Subject: [PATCH 2/3] Enable protein.sh test on gh actions --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a94364f..99e4e40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,8 +56,8 @@ jobs: *-apple-darwin) make all-mac-openmp ;; esac - # - name: Run tests (skip as this takes too long) - # run: | - # pwd - # cd tests - # bash protein.sh + - name: Run tests (skip as this takes too long) + run: | + pwd + cd tests + bash protein.sh From 6d64d360745dd9f7683350f2789f04c5aae59344 Mon Sep 17 00:00:00 2001 From: Aaron Kollasch Date: Fri, 20 Jan 2023 22:26:09 -0500 Subject: [PATCH 3/3] Move end-to-end test to optional gh action --- .github/workflows/end_to_end.yml | 63 ++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 12 +++--- 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/end_to_end.yml diff --git a/.github/workflows/end_to_end.yml b/.github/workflows/end_to_end.yml new file mode 100644 index 0000000..898cd4e --- /dev/null +++ b/.github/workflows/end_to_end.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 99e4e40..3802d0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -56,8 +56,8 @@ jobs: *-apple-darwin) make all-mac-openmp ;; esac - - name: Run tests (skip as this takes too long) - run: | - pwd - cd tests - bash protein.sh + # - name: Run tests (skip as this takes too long) + # run: | + # pwd + # cd tests + # bash protein.sh