From 84a9124890a16a3dedf54e150a725d41f5e91139 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 13 Jun 2024 14:00:55 +0200 Subject: [PATCH 1/4] Test the binary for missing shared object dependencies and execution Signed-off-by: Benoit Donneaux --- .github/workflows/go.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 55e1e72..afd1daa 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -54,3 +54,9 @@ jobs: id: go_make run: | docker compose run go-shell sh -c "make mockdeps && make" + + - name: Test binary + id: test_binary + run: | + ldd ../MoveOffTrac/trac2gitea/trac2gitea | grep 'not found' && { echo FAIL; exit 1; } || echo PASS + ./trac2gitea --help 2>&1 | grep '^Usage' && echo PASS || { echo FAIL; exit 1; } From 929997cdba116e5e81ed1aaff2f6c0a6acaae96a Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 13 Jun 2024 14:16:30 +0200 Subject: [PATCH 2/4] Improve test output Signed-off-by: Benoit Donneaux --- .github/workflows/go.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index afd1daa..c1910b9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -58,5 +58,11 @@ jobs: - name: Test binary id: test_binary run: | - ldd ../MoveOffTrac/trac2gitea/trac2gitea | grep 'not found' && { echo FAIL; exit 1; } || echo PASS - ./trac2gitea --help 2>&1 | grep '^Usage' && echo PASS || { echo FAIL; exit 1; } + echo -n "Test for a static executable: " + ldd ../MoveOffTrac/trac2gitea/trac2gitea | grep -q 'not a dynamic executable' \ + && echo PASS \ + || { echo FAIL; exit 1; } + echo -n "Test for usage prompt on execution: " + ./trac2gitea --help 2>&1 | grep -q '^Usage' \ + && echo 'PASS' \ + || { echo 'FAIL'; exit 1; } From 6a502ded3edb4287de123e7fbca7cd346d3819ac Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 13 Jun 2024 14:20:16 +0200 Subject: [PATCH 3/4] Fix wrong executable path Signed-off-by: Benoit Donneaux --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c1910b9..fa738da 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -59,7 +59,7 @@ jobs: id: test_binary run: | echo -n "Test for a static executable: " - ldd ../MoveOffTrac/trac2gitea/trac2gitea | grep -q 'not a dynamic executable' \ + ldd ../trac2gitea | grep -q 'not a dynamic executable' \ && echo PASS \ || { echo FAIL; exit 1; } echo -n "Test for usage prompt on execution: " From 9d673c5fab37693c40d14671e398bd043de3000c Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 13 Jun 2024 14:24:38 +0200 Subject: [PATCH 4/4] Just add a comment so the step output looks better Signed-off-by: Benoit Donneaux --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fa738da..ff1e788 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -58,6 +58,7 @@ jobs: - name: Test binary id: test_binary run: | + # Run some basic test on the binary built earlier echo -n "Test for a static executable: " ldd ../trac2gitea | grep -q 'not a dynamic executable' \ && echo PASS \