Skip to content

Commit 362e95c

Browse files
authored
Merge pull request #146 from griffithlab/kcotto-patch-1
Setup github action testing
2 parents 3ae1c9d + 23446da commit 362e95c

File tree

4 files changed

+57
-6
lines changed

4 files changed

+57
-6
lines changed

.github/workflows/cmake.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CMake
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
BUILD_TYPE: coverage
12+
13+
jobs:
14+
build:
15+
# The CMake configure and build commands are platform agnostic and should work equally
16+
# well on Windows or Mac. You can convert this to a matrix build if you need
17+
# cross-platform coverage.
18+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Configure CMake
25+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
26+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
27+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
28+
29+
- name: Build
30+
# Build your program with the given configuration
31+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
32+
33+
- name: Test
34+
working-directory: ${{github.workspace}}/build
35+
# Execute tests defined by the CMake configuration.
36+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
37+
run: ctest -V
38+
39+
- name: Install dependencies
40+
shell: bash
41+
run: sudo apt-get update ; sudo apt-get install lcov
42+
43+
- name: Coverage
44+
run: cd build && lcov -c -d . -o cov.txt && lcov -e cov.txt "*/regtools/src/*" -o coverage.run.filtered.1 && lcov -r coverage.run.filtered.1 "*src/utils/*" "*/tests/*" -o coverage.run.filtered
45+
46+
- name: Coveralls
47+
uses: coverallsapp/github-action@master
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
path-to-lcov: build/coverage.run.filtered
51+

build-common/python/integrationtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def inputFiles(self, *names):
3434
return rv
3535

3636
def execute(self, args):
37-
print "args ", args
37+
print("args ", args)
3838
cmdline = "%s %s" %(self.exe_path, " ".join(args))
3939
vglog_file = self.tempFile("valgrind.log")
4040
return ValgrindWrapper(shlex.split(cmdline), vglog_file).run()
@@ -69,7 +69,7 @@ def assertMultiLineEqual(self, first, second, msg=None):
6969

7070
def main():
7171
if len(sys.argv) < 2:
72-
print "Error: required argument (path to test executable) missing"
72+
print('Error: required argument (path to test executable) missing')
7373
sys.exit(1)
7474
IntegrationTest.exe_path = sys.argv.pop()
7575
unittest.main()

tests/integration-test/test_cis_splice_effects_identify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def test_anchor_stranded(self):
241241
output_annotatedjunctions = self.tempFile("observed-cse-identify.out")
242242
output_annotatedvariants = self.tempFile("observed-cse-identify-variants.out")
243243
output_junctions = self.tempFile("observed-cse-identify-junctions.out")
244-
print "BAM1 is ", bam1
244+
print("BAM1 is ", bam1)
245245
for anchor in ["", "30"]:
246246
if anchor != "":
247247
anchor = "-a " + anchor
@@ -267,7 +267,7 @@ def test_anchor(self):
267267
output_annotatedjunctions = self.tempFile("observed-cse-identify.out")
268268
output_annotatedvariants = self.tempFile("observed-cse-identify-variants.out")
269269
output_junctions = self.tempFile("observed-cse-identify-junctions.out")
270-
print "BAM1 is ", bam1
270+
print("BAM1 is ", bam1)
271271
for anchor in ["", "30"]:
272272
if anchor != "":
273273
anchor = "-a " + anchor

tests/integration-test/test_junctions_extract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class TestExtract(IntegrationTest, unittest.TestCase):
3333
def test_junctions_extract_anchor_stranded(self):
3434
bam1 = self.inputFiles("bam/test_hcc1395.bam")[0]
3535
output_file = self.tempFile("extract.out")
36-
print "BAM1 is ", bam1
36+
print("BAM1 is ", bam1)
3737
for anchor in ["", "30"]:
3838
expected_file = self.inputFiles("junctions-extract/expected-stranded-a" +
3939
anchor + ".out")[0]
@@ -47,7 +47,7 @@ def test_junctions_extract_anchor_stranded(self):
4747
def test_junctions_extract_anchor(self):
4848
bam1 = self.inputFiles("bam/test_hcc1395.bam")[0]
4949
output_file = self.tempFile("extract.out")
50-
print "BAM1 is ", bam1
50+
print("BAM1 is ", bam1)
5151
for anchor in ["", "30"]:
5252
expected_file = self.inputFiles("junctions-extract/expected-a" +
5353
anchor + ".out")[0]

0 commit comments

Comments
 (0)