From 866db31f674b74be684394225e1d96ec472db043 Mon Sep 17 00:00:00 2001 From: kfang4 <110547566+kfang4@users.noreply.github.com> Date: Mon, 12 Jun 2023 12:41:17 -0400 Subject: [PATCH] Modify check_tab_delimited to ignore headers starting with # (#30) * Modify check_tab_delimited to ignore headers starting with # * Use the most recent annotated tag in releases * Bump version --------- Co-authored-by: Heather Ward --- .github/workflows/docker-build-push.yml | 2 +- README.md | 8 ++++---- action.yml | 10 +++++----- pyproject.toml | 2 +- src/wdlci/wdl_tests/check_tab_delimited.wdl | 5 +++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index e0e6bac..b665f95 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -16,7 +16,7 @@ jobs: id: prep run: | IMAGE="dnastack/wdl-ci" - VERSION_TAG=`git describe --tags` + VERSION_TAG=`git describe --tags --abbrev=0` LONG_VERSION_TAG=`git describe --tags --long --always` LATEST_TAG="latest" ALL_TAGS="${IMAGE}:${VERSION_TAG},${IMAGE}:${LONG_VERSION_TAG},${IMAGE}:${LATEST_TAG}" diff --git a/README.md b/README.md index 89576fa..92fbd1b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If any step of the action fails, the check will fail; however if some task tests # GitHub action usage ```yaml -- uses: dnastack/wdl-ci@v0.1.8 +- uses: dnastack/wdl-ci@v0.1.9 with: # Configuration file where tests can be found # Default: wdl-ci.config.json @@ -86,7 +86,7 @@ jobs: with: submodules: true - name: wdl-ci - uses: dnastack/wdl-ci@v0.1.8 + uses: dnastack/wdl-ci@v0.1.9 with: wallet-url: ${{ secrets.WALLET_URL }} wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }} @@ -114,7 +114,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: wdl-ci - uses: dnastack/wdl-ci@v0.1.8 + uses: dnastack/wdl-ci@v0.1.9 with: wallet-url: ${{ secrets.WALLET_URL }} wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }} @@ -144,7 +144,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: wdl-ci - uses: dnastack/wdl-ci@v0.1.8 + uses: dnastack/wdl-ci@v0.1.9 with: wallet-url: ${{ secrets.WALLET_URL }} wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }} diff --git a/action.yml b/action.yml index b9a7008..4454a24 100644 --- a/action.yml +++ b/action.yml @@ -50,19 +50,19 @@ runs: echo "WDL_CI_CUSTOM_TEST_WDL_DIR"=${{ inputs.wdl_ci_custom_test_wdl_dir }} >> $GITHUB_ENV fi - name: lint - uses: docker://dnastack/wdl-ci:v0.1.8 + uses: docker://dnastack/wdl-ci:v0.1.9 with: args: lint - name: detect-changes - uses: docker://dnastack/wdl-ci:v0.1.8 + uses: docker://dnastack/wdl-ci:v0.1.9 with: args: detect-changes - name: submit - uses: docker://dnastack/wdl-ci:v0.1.8 + uses: docker://dnastack/wdl-ci:v0.1.9 with: args: submit - name: monitor - uses: docker://dnastack/wdl-ci:v0.1.8 + uses: docker://dnastack/wdl-ci:v0.1.9 with: args: monitor --update-digests # If a test fails, still update task digests for any tests that succeeded @@ -76,6 +76,6 @@ runs: default_author: github_actions - name: cleanup if: always() - uses: docker://dnastack/wdl-ci:v0.1.8 + uses: docker://dnastack/wdl-ci:v0.1.9 with: args: cleanup diff --git a/pyproject.toml b/pyproject.toml index a35db06..7e31421 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "wdl-testing-cli" description = "DNAstack WDL testing CLI" -version = "v0.1.8" +version = "v0.1.9" authors = [ { name = "DNAstack", email = "devs@dnastack.com" } ] diff --git a/src/wdlci/wdl_tests/check_tab_delimited.wdl b/src/wdlci/wdl_tests/check_tab_delimited.wdl index bc21ab8..4441669 100644 --- a/src/wdlci/wdl_tests/check_tab_delimited.wdl +++ b/src/wdlci/wdl_tests/check_tab_delimited.wdl @@ -28,11 +28,12 @@ task check_tab_delimited { # Validated dir path in input block vs. command block is different validated_dir_path=$(dirname ~{validated_output}) - if ! awk '{exit !/\t/}' "${validated_dir_path}/$(basename ~{validated_output} .gz)"; then + # Disregard headers starting with `#` + if ! sed '/^#/d' "${validated_dir_path}/$(basename ~{validated_output} .gz)" | awk '{exit !/\t/}'; then err "Validated file: [~{basename(validated_output)}] is not tab-delimited" exit 1 else - if awk '{exit !/\t/}' ~{current_run_output_unzipped}; then + if sed '/^#/d' ~{current_run_output_unzipped} | awk '{exit !/\t/}'; then echo "Current run file: [~{basename(current_run_output)}] is tab-delimited" else err "Current run file: [~{basename(current_run_output)}] is not tab-delimited"