From 3ba07a22c01a21b22e9cf46971afc6a93a4090f4 Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 08:29:23 -0800 Subject: [PATCH 01/12] Try same env var for action and container timeout --- .github/workflows/run-tarpaulin.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index e058e4f7b..338365075 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -16,11 +16,12 @@ on: env: CARGO_TERM_COLOR: always + TARPAULIN_TIMEOUT_MINUTES: 30 jobs: build: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: ${{ env.TARPAULIN_TIMEOUT_MINUTES }} steps: - name: Checkout the head commit of the branch @@ -29,7 +30,7 @@ jobs: persist-credentials: false - name: Create tarpaulin instance - run: docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo 'sleep 20m; echo bye' > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt + run: docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo 'sleep ${{ env.TARPAULIN_TIMEOUT_MINUTES }}m; echo bye' > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance run: docker start $(cat container_id.txt) - name: Install linux requirement in tarpaulin instance From 2235e8e09635be04f99af299f941f07731393c80 Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 08:35:42 -0800 Subject: [PATCH 02/12] output script to verify --- .github/workflows/run-tarpaulin.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 338365075..1f35becaa 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -30,7 +30,10 @@ jobs: persist-credentials: false - name: Create tarpaulin instance - run: docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo 'sleep ${{ env.TARPAULIN_TIMEOUT_MINUTES }}m; echo bye' > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt + run: | + STAY_ALIVE_SCRIPT = "sleep ${{ env.TARPAULIN_TIMEOUT_MINUTES }}m; echo bye" + echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" + docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance run: docker start $(cat container_id.txt) - name: Install linux requirement in tarpaulin instance From 87e7ca75ccf4294c00b0b6c26d8c71edad870670 Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 08:42:45 -0800 Subject: [PATCH 03/12] try reusing timeout-minutes directly --- .github/workflows/run-tarpaulin.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 1f35becaa..8fdee8742 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -16,12 +16,11 @@ on: env: CARGO_TERM_COLOR: always - TARPAULIN_TIMEOUT_MINUTES: 30 jobs: build: runs-on: ubuntu-latest - timeout-minutes: ${{ env.TARPAULIN_TIMEOUT_MINUTES }} + timeout-minutes: 30 steps: - name: Checkout the head commit of the branch @@ -31,7 +30,7 @@ jobs: - name: Create tarpaulin instance run: | - STAY_ALIVE_SCRIPT = "sleep ${{ env.TARPAULIN_TIMEOUT_MINUTES }}m; echo bye" + STAY_ALIVE_SCRIPT = "sleep ${{ jobs.build.timeout-minutes }}m; echo bye" echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance From a53594c694c62c06428dcefb2d505ec4c63460eb Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 08:49:50 -0800 Subject: [PATCH 04/12] Try moving timeout to step and access that directly --- .github/workflows/run-tarpaulin.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 8fdee8742..b0697eb77 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -20,7 +20,6 @@ env: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 30 steps: - name: Checkout the head commit of the branch @@ -30,16 +29,20 @@ jobs: - name: Create tarpaulin instance run: | - STAY_ALIVE_SCRIPT = "sleep ${{ jobs.build.timeout-minutes }}m; echo bye" + STAY_ALIVE_SCRIPT = "sleep ${{ steps.run-coverage-tests.timeout-minutes }}m; echo bye" echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance run: docker start $(cat container_id.txt) - name: Install linux requirement in tarpaulin instance + timeout-minutes: 5 run: docker exec $(cat container_id.txt) sh -c "echo Run apt update and apt install the following dependencies - git curl libssl-dev pkg-config libudev-dev libv4l-dev ; apt update ; apt install -y git curl libssl-dev pkg-config libudev-dev libv4l-dev" - name: Install rust requirements in tarpaulin instance + timeout-minutes: 5 run: docker exec $(cat container_id.txt) sh -c "rustup component add rustfmt" - name: Run tarpaulin + id: run-coverage-tests + timeout-minutes: 30 run: docker exec $(cat container_id.txt) sh -c "RUST_LOG=trace cargo tarpaulin -v --all-features --out Xml" - name: Upload report to codecov for push From 5bd7b0c1f9588ce3e21f7d7299c0da30151d29ac Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 08:51:35 -0800 Subject: [PATCH 05/12] try fixing env var creation --- .github/workflows/run-tarpaulin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index b0697eb77..6d199bada 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -29,7 +29,7 @@ jobs: - name: Create tarpaulin instance run: | - STAY_ALIVE_SCRIPT = "sleep ${{ steps.run-coverage-tests.timeout-minutes }}m; echo bye" + STAY_ALIVE_SCRIPT="sleep ${{ steps.run-coverage-tests.timeout-minutes }}m; echo bye" echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance From d82dd0a1db1bc4c4f85c40deb861a884f2b38b6e Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:01:16 -0800 Subject: [PATCH 06/12] try using env var again https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-context suggests timeout-minutes can be set from env --- .github/workflows/run-tarpaulin.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 6d199bada..50eaed647 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -16,10 +16,12 @@ on: env: CARGO_TERM_COLOR: always + TARPAULIN_TIMEOUT_MINUTES: 30 jobs: build: runs-on: ubuntu-latest + timeout-minutes: ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }} steps: - name: Checkout the head commit of the branch @@ -29,7 +31,7 @@ jobs: - name: Create tarpaulin instance run: | - STAY_ALIVE_SCRIPT="sleep ${{ steps.run-coverage-tests.timeout-minutes }}m; echo bye" + STAY_ALIVE_SCRIPT="sleep ${{ env.TARPAULIN_TIMEOUT_MINUTES }}m; echo bye" echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance From 7f907d576c6db4c563baf77894b0fe9a38214961 Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:09:10 -0800 Subject: [PATCH 07/12] Use step.timeout-minutes because it can pull from env var --- .github/workflows/run-tarpaulin.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 50eaed647..6a3eadde2 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -21,7 +21,6 @@ env: jobs: build: runs-on: ubuntu-latest - timeout-minutes: ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }} steps: - name: Checkout the head commit of the branch @@ -31,7 +30,7 @@ jobs: - name: Create tarpaulin instance run: | - STAY_ALIVE_SCRIPT="sleep ${{ env.TARPAULIN_TIMEOUT_MINUTES }}m; echo bye" + STAY_ALIVE_SCRIPT="sleep ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }}m; echo bye" echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance @@ -44,7 +43,7 @@ jobs: run: docker exec $(cat container_id.txt) sh -c "rustup component add rustfmt" - name: Run tarpaulin id: run-coverage-tests - timeout-minutes: 30 + timeout-minutes: ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }} run: docker exec $(cat container_id.txt) sh -c "RUST_LOG=trace cargo tarpaulin -v --all-features --out Xml" - name: Upload report to codecov for push From f948b6c912f80e56fbc85d20d16359a62d0d6355 Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:12:39 -0800 Subject: [PATCH 08/12] Update run-tarpaulin.yml --- .github/workflows/run-tarpaulin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 6a3eadde2..5ca2bed39 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -32,7 +32,7 @@ jobs: run: | STAY_ALIVE_SCRIPT="sleep ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }}m; echo bye" echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" - docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo $STAY_ALIVE_SCRIPT > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt + docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo ${STAY_ALIVE_SCRIPT} > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance run: docker start $(cat container_id.txt) - name: Install linux requirement in tarpaulin instance From da6fed98b2e2ffba5555cd9c066a0ef9e3838926 Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:35:10 -0800 Subject: [PATCH 09/12] just make the docker keep alive script sleep 600 minutes --- .github/workflows/run-tarpaulin.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 5ca2bed39..4f50dc5ae 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -21,6 +21,14 @@ env: jobs: build: runs-on: ubuntu-latest + # There is a second, hidden timeout in this workflow. When the tarpaulin container is created, + # it is created with a CMD that sleeps for 600 minutes. A more reasonable value could be selected, + # but it seems easier to make it SOOOO big that timeout-minutes is likely to never be impacted by + # by it. + # + # But, if thiw workflow is mysteriously timing out after 600 minutes, make changes to the docker + # create command in the Create tarpaulin instance step. + timeout-minutes: 30 steps: - name: Checkout the head commit of the branch @@ -29,21 +37,14 @@ jobs: persist-credentials: false - name: Create tarpaulin instance - run: | - STAY_ALIVE_SCRIPT="sleep ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }}m; echo bye" - echo "Using this as stay-alive script: [ $STAY_ALIVE_SCRIPT ]" - docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo ${STAY_ALIVE_SCRIPT} > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt + run: docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.16.0 bash -c "echo 'sleep 600m; echo bye' > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt - name: Start tarpaulin instance run: docker start $(cat container_id.txt) - name: Install linux requirement in tarpaulin instance - timeout-minutes: 5 run: docker exec $(cat container_id.txt) sh -c "echo Run apt update and apt install the following dependencies - git curl libssl-dev pkg-config libudev-dev libv4l-dev ; apt update ; apt install -y git curl libssl-dev pkg-config libudev-dev libv4l-dev" - name: Install rust requirements in tarpaulin instance - timeout-minutes: 5 run: docker exec $(cat container_id.txt) sh -c "rustup component add rustfmt" - name: Run tarpaulin - id: run-coverage-tests - timeout-minutes: ${{ fromJSON(env.TARPAULIN_TIMEOUT_MINUTES) }} run: docker exec $(cat container_id.txt) sh -c "RUST_LOG=trace cargo tarpaulin -v --all-features --out Xml" - name: Upload report to codecov for push From 2a3d48acfc316e0eac20cfe2c946398bf9615a6d Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:35:46 -0800 Subject: [PATCH 10/12] remove env var --- .github/workflows/run-tarpaulin.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 4f50dc5ae..bf2bea5d3 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -16,7 +16,6 @@ on: env: CARGO_TERM_COLOR: always - TARPAULIN_TIMEOUT_MINUTES: 30 jobs: build: From 7ca3292b707ee1c6d5304b9cf56c1aa05255c10c Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:38:17 -0800 Subject: [PATCH 11/12] fix typo --- .github/workflows/run-tarpaulin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index bf2bea5d3..38488f82f 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -25,7 +25,7 @@ jobs: # but it seems easier to make it SOOOO big that timeout-minutes is likely to never be impacted by # by it. # - # But, if thiw workflow is mysteriously timing out after 600 minutes, make changes to the docker + # But, if this workflow is mysteriously timing out after 600 minutes, make changes to the docker # create command in the Create tarpaulin instance step. timeout-minutes: 30 From f5fa411b2ed684f71e9bcc26b370df66e2dec8ed Mon Sep 17 00:00:00 2001 From: bfjelds Date: Tue, 9 Mar 2021 09:42:14 -0800 Subject: [PATCH 12/12] typos, typos, typos --- .github/workflows/run-tarpaulin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tarpaulin.yml b/.github/workflows/run-tarpaulin.yml index 38488f82f..1a5e4bdb8 100644 --- a/.github/workflows/run-tarpaulin.yml +++ b/.github/workflows/run-tarpaulin.yml @@ -23,7 +23,7 @@ jobs: # There is a second, hidden timeout in this workflow. When the tarpaulin container is created, # it is created with a CMD that sleeps for 600 minutes. A more reasonable value could be selected, # but it seems easier to make it SOOOO big that timeout-minutes is likely to never be impacted by - # by it. + # it. # # But, if this workflow is mysteriously timing out after 600 minutes, make changes to the docker # create command in the Create tarpaulin instance step.