From 328151678397aa0a086e3294cb3bf91cea15e6c6 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Tue, 31 Jan 2023 16:57:06 -0500 Subject: [PATCH 1/8] Adding a gh actions test --- .github/workflows/tests.yml | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..378526edf5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,62 @@ +# This is a github actions workflow which runs picard tests + +name: Build and Test +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 8, 11 ] + experimental: [false] + run_barclay_tests: [true, false] +# include: +# - java: 17 +# experimental: true + fail-fast: false + continue-on-error: ${{ matrix.experimental }} + name: Java ${{ matrix.Java }} build and test + steps: + - uses: actions/checkout@v2 + - name: Set up java ${{ matrix.Java }} + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.Java }} + distribution: 'adopt' + cache: gradle + - name: "set up R" + run: | + wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + apt-get -qq update + apt-get install -y --no-install-recommends r-base-dev r-recommended qpdf + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Compile with Gradle + run: ./gradlew compileJava + - name: Run tests + run: | + if [[ ${{matrix.run_barclay_tests}} == true ]]; then + echo "Running tests using the Barclay command line parser." + ./gradlew barclayTest + else + echo "Running tests using the legacy Picard command line parser." + ./gradlew jacocoTestReport + fi + - name: "Build the jar and run a commandline test for sanity checking"" + run: | + ./gradlew currentJar + java -jar build/libs/picard.jar MarkDuplicates -I testdata/picard/sam/aligned_queryname_sorted.bam -O out.bam --METRICS_FILE out.metrics + - name: Upload test results + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-results-${{ matrix.Java }} + path: build/reports/tests + + + From ca4d4d9743a1cb08e87ae3b8eab974b633bbb342 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Tue, 31 Jan 2023 16:59:22 -0500 Subject: [PATCH 2/8] fixup --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 378526edf5..13bd207af4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,7 +47,7 @@ jobs: echo "Running tests using the legacy Picard command line parser." ./gradlew jacocoTestReport fi - - name: "Build the jar and run a commandline test for sanity checking"" + - name: "Build the jar and run a commandline test for sanity checking" run: | ./gradlew currentJar java -jar build/libs/picard.jar MarkDuplicates -I testdata/picard/sam/aligned_queryname_sorted.bam -O out.bam --METRICS_FILE out.metrics From a720b82155afac69025ccfd5789814769efbca09 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Tue, 31 Jan 2023 17:01:46 -0500 Subject: [PATCH 3/8] fixpu --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13bd207af4..3510d80257 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,8 +32,8 @@ jobs: - name: "set up R" run: | wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - apt-get -qq update - apt-get install -y --no-install-recommends r-base-dev r-recommended qpdf + sudo apt-get -qq update + sudo apt-get install -y --no-install-recommends r-base-dev r-recommended qpdf - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Compile with Gradle From d2934e508335fd3f20bd2cd34a17ba2dd2a8eb57 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Tue, 31 Jan 2023 17:08:50 -0500 Subject: [PATCH 4/8] improve name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3510d80257..50b6306b56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: # experimental: true fail-fast: false continue-on-error: ${{ matrix.experimental }} - name: Java ${{ matrix.Java }} build and test + name: Java ${{ matrix.Java }} / Barclay=${{ matrix.run_barclay_tests}} tests steps: - uses: actions/checkout@v2 - name: Set up java ${{ matrix.Java }} From c90508c34f2a5913665fff89e008cc71645463c6 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Tue, 31 Jan 2023 17:12:08 -0500 Subject: [PATCH 5/8] fixup --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 50b6306b56..e996755b81 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: # experimental: true fail-fast: false continue-on-error: ${{ matrix.experimental }} - name: Java ${{ matrix.Java }} / Barclay=${{ matrix.run_barclay_tests}} tests + name: Java ${{ matrix.Java }}, Barclay=${{ matrix.run_barclay_tests}} tests steps: - uses: actions/checkout@v2 - name: Set up java ${{ matrix.Java }} From bc6ea45bc07215fbbc3bb8ec3d4eb60d0dd41d9d Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Wed, 1 Feb 2023 15:18:50 -0500 Subject: [PATCH 6/8] fix artifact name --- .github/workflows/tests.yml | 2 +- .travis.yml | 45 ------------------------------------- README.md | 3 +-- 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e996755b81..d2ed02fd30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: if: always() uses: actions/upload-artifact@v2 with: - name: test-results-${{ matrix.Java }} + name: test-results-${{ matrix.Java }}-barclay-${{matrix.run_barclay_test}} path: build/reports/tests diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27bd152563..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -dist: xenial -language: java -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/.m2 -env: - matrix: - - RUN_BARCLAY_TESTS=true - - RUN_BARCLAY_TESTS=false -jdk: - # oraclejdk8 - Xenial does not support oraclejdk8 - - openjdk8 - - openjdk11 -before_install: - #skip push builds if there's an associated PR because we don't look at them anway - - if [[ ${TRAVIS_EVENT_TYPE} == push ]]; then - PULL_REQUESTS=$( scripts/travis/check_for_pull_request ); - if [[ $( grep -c "commits" <<< ${PULL_REQUESTS} ) -gt 0 ]]; then - echo "WARNING TEST SKIPPED. TESTS DO NOT RUN ON BRANCHES WITH OPEN PULL REQUESTS. SEE PULL REQUEST FOR TEST RESULTS"; - travis_terminate 0; - fi; - fi; - - wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - - sudo apt-get -qq update - - sudo apt-get install -y --no-install-recommends r-base-dev r-recommended qpdf -script: - - if [[ $RUN_BARCLAY_TESTS == true ]]; then - echo "Running tests using the Barclay command line parser."; - ./gradlew barclayTest; - else - echo "Running tests using the legacy Picard command line parser."; - ./gradlew jacocoTestReport; - fi - # build the jar and execute a non-trivial tool in order to verify Java command line execution compatibility - - ./gradlew currentJar - - java -jar build/libs/picard.jar MarkDuplicates -I testdata/picard/sam/aligned_queryname_sorted.bam -O out.bam --METRICS_FILE out.metrics -after_success: - - ./gradlew coveralls - - if [ "$TRAVIS_BRANCH" == "master" ]; then - ./gradlew uploadArchives; - fi diff --git a/README.md b/README.md index c9f7d11aed..82cd73155b 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ For user questions please look for answers and ask first in the [GATK forum](htt ---- -[![Coverage Status](https://coveralls.io/repos/github/broadinstitute/picard/badge.svg?branch=master)](https://coveralls.io/github/broadinstitute/picard?branch=master) -[![Build Status](https://travis-ci.com/broadinstitute/picard.svg?branch=master)](https://travis-ci.com/broadinstitute/picard) +[![Build Status](https://github.com/broadinstitute/picard/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/broadinstitute/picard/actions/workflows/tests.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/broadinstitute/picard/blob/master/LICENSE.txt) A set of Java command line tools for manipulating high-throughput sequencing (HTS) data and formats. From 5f934b39512ac73cc1f9ab8761e8c43e77cc2966 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Wed, 1 Feb 2023 15:32:35 -0500 Subject: [PATCH 7/8] update to new v3 actions --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2ed02fd30..09252d0c10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,9 +22,9 @@ jobs: continue-on-error: ${{ matrix.experimental }} name: Java ${{ matrix.Java }}, Barclay=${{ matrix.run_barclay_tests}} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up java ${{ matrix.Java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.Java }} distribution: 'adopt' @@ -53,7 +53,7 @@ jobs: java -jar build/libs/picard.jar MarkDuplicates -I testdata/picard/sam/aligned_queryname_sorted.bam -O out.bam --METRICS_FILE out.metrics - name: Upload test results if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: test-results-${{ matrix.Java }}-barclay-${{matrix.run_barclay_test}} path: build/reports/tests From 1312dcc96be4efcb7fd78d51a1667b9c923bf05e Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Wed, 1 Feb 2023 16:13:13 -0500 Subject: [PATCH 8/8] fixup again... --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 09252d0c10..224e718da5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - name: test-results-${{ matrix.Java }}-barclay-${{matrix.run_barclay_test}} + name: test-results-${{ matrix.Java }}-barclay-${{ matrix.run_barclay_tests}} path: build/reports/tests