From 06ec03bafd6a24b239886e805d32836c2097993c Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 18:17:12 -0700 Subject: [PATCH 01/38] Debug container start test --- .github/actions/docker/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 8e12c3d0..799888cc 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -142,6 +142,8 @@ runs: id: test shell: bash run: | + docker images + echo "${{ steps.meta.outputs.tags }}" docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} ${{ inputs.CONTAINER_TEST_COMMAND }} sleep 20 docker logs test > logs.txt From 38cb1f5235f0ccff7d9946ff8d651e6ee1c889ef Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 21:28:08 -0700 Subject: [PATCH 02/38] debug --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efdbd583..d74a6f81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -237,7 +237,7 @@ jobs: BUILD: name: BUILD needs: CHECK - uses: signalwire/actions-template/.github/workflows/ci-build.yml@main + uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/debug-container-test with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From 3808d1585ad3b95c29e5f99ffba14d38d5c60fca Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 21:32:35 -0700 Subject: [PATCH 03/38] debug --- .github/actions/test-ruby/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 1bf14d69..1464eb13 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -26,6 +26,10 @@ inputs: required: false description: Reviewdog report default: 'false' + RUN_TESTS: + required: false + default: 'true' + description: Whenever you wanna run tests. runs: using: "composite" @@ -119,6 +123,7 @@ runs: shell: bash - name: Run Tests + if: inputs.RUN_TESTS != 'false' run: | bundle exec rspec -f j -o tmp/rspec_results.json -f p shell: bash From 1794dcb6d554da5e9ede86d26194ed23c7c6b22c Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 21:45:57 -0700 Subject: [PATCH 04/38] debug --- .github/workflows/ci-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 083445bf..400899f4 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -188,9 +188,9 @@ jobs: steps: - uses: actions/checkout@v4 - with: - ref: ${{ inputs.REF || github.ref }} - fetch-depth: 0 + # with: + # ref: ${{ inputs.REF || github.ref }} + # fetch-depth: 0 - name: Update git if: ${{ inputs.SUBMODULES_RECURSIVE == true && inputs.SUBMODULES_PRIVATE == true }} From e13fc3462d3fc180655ced90e7081ccd586293f4 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 21:46:19 -0700 Subject: [PATCH 05/38] ignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5ae19268..e5e8094f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -./sonarscanner \ No newline at end of file +./sonarscanner +.DS_Store From 9c2ad43181770ddba2f59822415f73fa8d09e647 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 21:49:55 -0700 Subject: [PATCH 06/38] debug --- .github/workflows/ci-build.yml | 6 +++--- .github/workflows/ci-check.yml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 400899f4..0c1d5149 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -188,9 +188,9 @@ jobs: steps: - uses: actions/checkout@v4 - # with: - # ref: ${{ inputs.REF || github.ref }} - # fetch-depth: 0 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 - name: Update git if: ${{ inputs.SUBMODULES_RECURSIVE == true && inputs.SUBMODULES_PRIVATE == true }} diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index ad7c6039..167a5964 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -133,6 +133,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Update git From e9ccfb6b4fc5369349fb3d0cd987d0ca64b00b95 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 21:52:35 -0700 Subject: [PATCH 07/38] debug --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d74a6f81..3b3c09c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,7 +199,7 @@ jobs: CHECK: name: CI - uses: signalwire/actions-template/.github/workflows/ci-check.yml@main + uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/debug-container-test with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From 64fae3bca2ced7f86a20c8d530797970f4614d8e Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Apr 2024 22:00:04 -0700 Subject: [PATCH 08/38] debug --- .github/actions/test-ruby/action.yml | 5 ----- .github/workflows/ci-build.yml | 2 +- .github/workflows/ci-check.yml | 1 - .github/workflows/ci.yml | 4 ++-- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 1464eb13..1bf14d69 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -26,10 +26,6 @@ inputs: required: false description: Reviewdog report default: 'false' - RUN_TESTS: - required: false - default: 'true' - description: Whenever you wanna run tests. runs: using: "composite" @@ -123,7 +119,6 @@ runs: shell: bash - name: Run Tests - if: inputs.RUN_TESTS != 'false' run: | bundle exec rspec -f j -o tmp/rspec_results.json -f p shell: bash diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 0c1d5149..083445bf 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -189,7 +189,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ inputs.REF || github.ref }} fetch-depth: 0 - name: Update git diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index 167a5964..ad7c6039 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -133,7 +133,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Update git diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b3c09c3..efdbd583 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,7 +199,7 @@ jobs: CHECK: name: CI - uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/debug-container-test + uses: signalwire/actions-template/.github/workflows/ci-check.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} @@ -237,7 +237,7 @@ jobs: BUILD: name: BUILD needs: CHECK - uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/debug-container-test + uses: signalwire/actions-template/.github/workflows/ci-build.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From 4c34af61da5c80eb011f9f35d232708fd43b38e0 Mon Sep 17 00:00:00 2001 From: Chris Clement Date: Tue, 30 Apr 2024 18:56:35 -0400 Subject: [PATCH 09/38] Update ref for ci-build workflow and set REF --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efdbd583..c6b15394 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -237,8 +237,9 @@ jobs: BUILD: name: BUILD needs: CHECK - uses: signalwire/actions-template/.github/workflows/ci-build.yml@main + uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/debug-container-test with: + REF: "ryanwi/debug-container-test" ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} SUBMODULES_RECURSIVE: ${{ inputs.SUBMODULES_RECURSIVE }} From 702193e2108d282d1a5dfb67d4e3fcd9d12a53af Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 11:56:31 -0700 Subject: [PATCH 10/38] no main --- .github/actions/test-ruby/action.yml | 5 +++++ .github/workflows/ci-build.yml | 2 +- .github/workflows/ci-check.yml | 2 +- .github/workflows/ci.yml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 1bf14d69..1464eb13 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -26,6 +26,10 @@ inputs: required: false description: Reviewdog report default: 'false' + RUN_TESTS: + required: false + default: 'true' + description: Whenever you wanna run tests. runs: using: "composite" @@ -119,6 +123,7 @@ runs: shell: bash - name: Run Tests + if: inputs.RUN_TESTS != 'false' run: | bundle exec rspec -f j -o tmp/rspec_results.json -f p shell: bash diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 083445bf..988b7b00 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -225,7 +225,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: main + ref: ryanwi/debug-container-test path: actions - uses: ./actions/.github/actions/gpg diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index ad7c6039..ca4fb5d2 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -152,7 +152,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: main + ref: ryanwi/debug-container-test path: actions - name: Retrieve Secrets from HashiCorp Vault diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6b15394..ec29f626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,7 +199,7 @@ jobs: CHECK: name: CI - uses: signalwire/actions-template/.github/workflows/ci-check.yml@main + uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/debug-container-test with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From 5c98a03204a32888223d23a560fad4799e507ab3 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 11:57:06 -0700 Subject: [PATCH 11/38] no main --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec29f626..3b3c09c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,7 +239,6 @@ jobs: needs: CHECK uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/debug-container-test with: - REF: "ryanwi/debug-container-test" ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} SUBMODULES_RECURSIVE: ${{ inputs.SUBMODULES_RECURSIVE }} From e14e3b7d55c681a3505dd48e6fdd13032db065fa Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:25:42 -0700 Subject: [PATCH 12/38] speed up debugging --- .github/actions/test-ruby/action.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 1464eb13..f50aaf33 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -122,15 +122,15 @@ runs: done shell: bash - - name: Run Tests - if: inputs.RUN_TESTS != 'false' - run: | - bundle exec rspec -f j -o tmp/rspec_results.json -f p - shell: bash + # - name: Run Tests + # if: inputs.RUN_TESTS != 'false' + # run: | + # bundle exec rspec -f j -o tmp/rspec_results.json -f p + # shell: bash - - name: RSpec Report - if: always() - uses: SonicGarden/rspec-report-action@v3 - with: - token: ${{ env.GITHUB_TOKEN }} - json-path: tmp/rspec_results.json + # - name: RSpec Report + # if: always() + # uses: SonicGarden/rspec-report-action@v3 + # with: + # token: ${{ env.GITHUB_TOKEN }} + # json-path: tmp/rspec_results.json From e492fb59002c50e1cb3f6fe80f9acfdcac153f70 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:27:11 -0700 Subject: [PATCH 13/38] speed up debugging --- .github/actions/test-ruby/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index f50aaf33..634b3145 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -122,6 +122,11 @@ runs: done shell: bash + - name: Run Tests + run: | + echo ${{ inputs.RUN_TESTS }} + shell: bash + # - name: Run Tests # if: inputs.RUN_TESTS != 'false' # run: | From 51ed366386d2d51b44c75c764ba46d9805f83253 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:44:50 -0700 Subject: [PATCH 14/38] speed up debugging --- .github/actions/docker/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 799888cc..9ccf1711 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -124,7 +124,7 @@ runs: - name: Build and export to Docker uses: docker/build-push-action@v5 - if: inputs.PLATFORMS == 'linux/amd64' && inputs.TAG_ONLY == 'false' + # if: inputs.PLATFORMS == 'linux/amd64' && inputs.TAG_ONLY == 'false' with: load: true tags: | From d75e5723e3ee64bdb8d62f929fdb982af5aac5fc Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:49:45 -0700 Subject: [PATCH 15/38] speed up debugging --- .github/actions/docker/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 9ccf1711..fd66a335 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -133,7 +133,7 @@ runs: # cache-to: type=gha,mode=max file: ${{ inputs.FILE }} context: ${{ inputs.CONTEXT }} - platforms: ${{ inputs.PLATFORMS }} + platforms: linux/amd64 build-args: ${{ env.BUILD_ARGS }} secrets: ${{ env.DOCKER_SECRETS }} From d9a909f349b0bb58d7a03f6ede76c599b7bfbd7a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:51:15 -0700 Subject: [PATCH 16/38] speed up debugging --- .github/actions/docker/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index fd66a335..00a3db7d 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -133,6 +133,7 @@ runs: # cache-to: type=gha,mode=max file: ${{ inputs.FILE }} context: ${{ inputs.CONTEXT }} + # cannot use multiple platforms with `load`, build a single arch image for validation purposes in CI platforms: linux/amd64 build-args: ${{ env.BUILD_ARGS }} secrets: ${{ env.DOCKER_SECRETS }} From 3629865042fc917ccd4ce56b538be3ea22e97c4c Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:53:45 -0700 Subject: [PATCH 17/38] speed up debugging --- .github/actions/docker/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 00a3db7d..8cc74c71 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -124,7 +124,7 @@ runs: - name: Build and export to Docker uses: docker/build-push-action@v5 - # if: inputs.PLATFORMS == 'linux/amd64' && inputs.TAG_ONLY == 'false' + if: inputs.TAG_ONLY == 'false' with: load: true tags: | From 952a36c8198e219f09519c26ee811c723409c73d Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 12:56:23 -0700 Subject: [PATCH 18/38] speed up debugging --- .github/actions/docker/action.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 8cc74c71..d3ebe0e5 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -144,15 +144,16 @@ runs: shell: bash run: | docker images - echo "${{ steps.meta.outputs.tags }}" + echo "Starting container for image: ${{ steps.meta.outputs.tags }}" docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} ${{ inputs.CONTAINER_TEST_COMMAND }} sleep 20 - docker logs test > logs.txt - EXECUTIONLOG=$(cat logs.txt) - EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" - EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" - EXECUTIONLOG="${EXECUTIONLOG//$'\r'/'%0D'}" - echo "name=container-logs::$EXECUTIONLOG" >> $GITHUB_OUTPUT + docker logs + # test > logs.txt + # EXECUTIONLOG=$(cat logs.txt) + # EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" + # EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" + # EXECUTIONLOG="${EXECUTIONLOG//$'\r'/'%0D'}" + # echo "name=container-logs::$EXECUTIONLOG" >> $GITHUB_OUTPUT - name: Build and push if: inputs.PUSH == 'true' # && inputs.TAG_ONY == 'false' From a3644ad8e178ff4bf38fabd70abf27e35b72e86b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 13:01:53 -0700 Subject: [PATCH 19/38] speed up debugging --- .github/actions/docker/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index d3ebe0e5..365e3914 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -147,7 +147,7 @@ runs: echo "Starting container for image: ${{ steps.meta.outputs.tags }}" docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} ${{ inputs.CONTAINER_TEST_COMMAND }} sleep 20 - docker logs + docker logs test # test > logs.txt # EXECUTIONLOG=$(cat logs.txt) # EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" From b8ad0ac2b73f4624273cafe556c81b78646f6681 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 13:02:54 -0700 Subject: [PATCH 20/38] speed up debugging --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b3c09c3..5504450c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,6 +91,10 @@ on: type: boolean default: true description: 'Whenever the container should be tested on pr.' + CONTAINER_TEST_COMMAND: + type: string + default: '' + description: 'A custom command to test the docker container.' RUNNER: type: string default: 'ubuntu-latest' From 3c3c86748bcf8f5639ec8fc28b6522084957d6f2 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 13:04:37 -0700 Subject: [PATCH 21/38] speed up debugging From 4bee1ca8ba2e6ba0f7aae14f9a752375052e1bc9 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 13:06:45 -0700 Subject: [PATCH 22/38] speed up debugging --- .github/actions/docker/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 365e3914..dee035ff 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -129,8 +129,8 @@ runs: load: true tags: | ${{ steps.meta.outputs.tags }} - # cache-from: type=gha - # cache-to: type=gha,mode=max + cache-from: type=gha + cache-to: type=gha,mode=max file: ${{ inputs.FILE }} context: ${{ inputs.CONTEXT }} # cannot use multiple platforms with `load`, build a single arch image for validation purposes in CI From 27845107bf62759509014bb378d863e7a493dd2a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 13:33:52 -0700 Subject: [PATCH 23/38] move test command --- .github/actions/docker/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index dee035ff..c4b70708 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -145,9 +145,10 @@ runs: run: | docker images echo "Starting container for image: ${{ steps.meta.outputs.tags }}" - docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} ${{ inputs.CONTAINER_TEST_COMMAND }} + docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} sleep 20 - docker logs test + ${{ inputs.CONTAINER_TEST_COMMAND }} + # docker logs test # test > logs.txt # EXECUTIONLOG=$(cat logs.txt) # EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" From a5132cb7b6f9e2c64c16b417a7541f4b247f0add Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 15:36:08 -0700 Subject: [PATCH 24/38] container test command --- .github/actions/docker/action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index c4b70708..99634403 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -138,6 +138,10 @@ runs: build-args: ${{ env.BUILD_ARGS }} secrets: ${{ env.DOCKER_SECRETS }} + - shell: bash + run: | + echo ${{ inputs.CONTAINER_TEST_COMMAND }} + - name: Test if: github.event_name == 'pull_request' && inputs.CONTAINER_TEST == 'true' && inputs.TAG_ONLY == 'false' id: test @@ -147,7 +151,10 @@ runs: echo "Starting container for image: ${{ steps.meta.outputs.tags }}" docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} sleep 20 - ${{ inputs.CONTAINER_TEST_COMMAND }} + docker logs test + curl --fail --silent --location 'http://localhost:3000/healthcheck' + + # ${{ inputs.CONTAINER_TEST_COMMAND }} # docker logs test # test > logs.txt # EXECUTIONLOG=$(cat logs.txt) From ee3eab23112f49e7d77a5d4e39c5f09b317632bc Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 15:46:33 -0700 Subject: [PATCH 25/38] container test command --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5504450c..e8736de3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -255,6 +255,7 @@ jobs: PLATFORMS: ${{ inputs.PLATFORMS }} CONTAINER_SCAN: ${{ inputs.CONTAINER_SCAN }} CONTAINER_TEST: ${{ inputs.CONTAINER_TEST }} + CONTAINER_TEST_COMMAND: ${{ inputs.CONTAINER_TEST_COMMAND }} RUNNER: ${{ inputs.RUNNER }} TAG: ${{ inputs.TAG }} BUILD_ARGS: ${{ inputs.BUILD_ARGS }} From 91f94890146f3fe9c1c31134926904d48be0c54a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 15:52:29 -0700 Subject: [PATCH 26/38] container test command --- .github/actions/docker/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 99634403..1efd218c 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -151,10 +151,10 @@ runs: echo "Starting container for image: ${{ steps.meta.outputs.tags }}" docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} sleep 20 + docker ps docker logs test - curl --fail --silent --location 'http://localhost:3000/healthcheck' + ${{ inputs.CONTAINER_TEST_COMMAND }} - # ${{ inputs.CONTAINER_TEST_COMMAND }} # docker logs test # test > logs.txt # EXECUTIONLOG=$(cat logs.txt) From 0560dccbb2a25aa78b6830bb0c417ab557e67af6 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:01:30 -0700 Subject: [PATCH 27/38] container test command --- .github/actions/docker/action.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 1efd218c..dd1d7914 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -152,16 +152,13 @@ runs: docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} sleep 20 docker ps - docker logs test + docker logs test > logs.txt + EXECUTIONLOG=$(cat logs.txt) + EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" + EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" + EXECUTIONLOG="${EXECUTIONLOG//$'\r'/'%0D'}" + echo "name=container-logs::$EXECUTIONLOG" >> $GITHUB_OUTPUT ${{ inputs.CONTAINER_TEST_COMMAND }} - - # docker logs test - # test > logs.txt - # EXECUTIONLOG=$(cat logs.txt) - # EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" - # EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" - # EXECUTIONLOG="${EXECUTIONLOG//$'\r'/'%0D'}" - # echo "name=container-logs::$EXECUTIONLOG" >> $GITHUB_OUTPUT - name: Build and push if: inputs.PUSH == 'true' # && inputs.TAG_ONY == 'false' From c938fbff19d8ba84c35fc1d539432d3f726f4caf Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:02:21 -0700 Subject: [PATCH 28/38] container test command --- .github/actions/docker/action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index dd1d7914..04d9b95f 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -138,10 +138,6 @@ runs: build-args: ${{ env.BUILD_ARGS }} secrets: ${{ env.DOCKER_SECRETS }} - - shell: bash - run: | - echo ${{ inputs.CONTAINER_TEST_COMMAND }} - - name: Test if: github.event_name == 'pull_request' && inputs.CONTAINER_TEST == 'true' && inputs.TAG_ONLY == 'false' id: test From 4465bda13c280aa8c0d382644971c3bc2e8bcd17 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:03:32 -0700 Subject: [PATCH 29/38] container test command --- .github/actions/docker/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 04d9b95f..597ed87c 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -149,10 +149,12 @@ runs: sleep 20 docker ps docker logs test > logs.txt + docker logs EXECUTIONLOG=$(cat logs.txt) EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" EXECUTIONLOG="${EXECUTIONLOG//$'\r'/'%0D'}" + echo "$EXECUTIONLOG" echo "name=container-logs::$EXECUTIONLOG" >> $GITHUB_OUTPUT ${{ inputs.CONTAINER_TEST_COMMAND }} From 56234d29b4728bf3c15e71f83bef66b8b68f83f2 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:03:51 -0700 Subject: [PATCH 30/38] container test command --- .github/actions/docker/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 597ed87c..49673f2e 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -148,8 +148,8 @@ runs: docker run -d --rm --name test ${{ fromJSON(steps.meta.outputs.json).tags[0] }} sleep 20 docker ps + docker logs test docker logs test > logs.txt - docker logs EXECUTIONLOG=$(cat logs.txt) EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" From 8a216aabc7a02c81756d5f271ed0b4aa58aa0eff Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:04:22 -0700 Subject: [PATCH 31/38] container test command --- .github/actions/test-ruby/action.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 634b3145..9aca106e 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -26,10 +26,6 @@ inputs: required: false description: Reviewdog report default: 'false' - RUN_TESTS: - required: false - default: 'true' - description: Whenever you wanna run tests. runs: using: "composite" @@ -122,11 +118,6 @@ runs: done shell: bash - - name: Run Tests - run: | - echo ${{ inputs.RUN_TESTS }} - shell: bash - # - name: Run Tests # if: inputs.RUN_TESTS != 'false' # run: | From e7ef85f05fe6915e9ba1263b9319fee03c449b0f Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:11:00 -0700 Subject: [PATCH 32/38] container test command --- .github/actions/docker/action.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 49673f2e..703a434b 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -149,13 +149,6 @@ runs: sleep 20 docker ps docker logs test - docker logs test > logs.txt - EXECUTIONLOG=$(cat logs.txt) - EXECUTIONLOG="${EXECUTIONLOG//'%'/'%25'}" - EXECUTIONLOG="${EXECUTIONLOG//$'\n'/'%0A'}" - EXECUTIONLOG="${EXECUTIONLOG//$'\r'/'%0D'}" - echo "$EXECUTIONLOG" - echo "name=container-logs::$EXECUTIONLOG" >> $GITHUB_OUTPUT ${{ inputs.CONTAINER_TEST_COMMAND }} - name: Build and push From 76118ce98c2ee259306f435e61db76ee489efe47 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:11:53 -0700 Subject: [PATCH 33/38] container test command From ff1ab71d872b42c3db5497f81e5df4e6417e731b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:17:22 -0700 Subject: [PATCH 34/38] reduce changes --- .github/actions/docker/action.yml | 4 ++-- .github/actions/test-ruby/action.yml | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 703a434b..97aa3ace 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -129,8 +129,8 @@ runs: load: true tags: | ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max + # cache-from: type=gha + # cache-to: type=gha,mode=max file: ${{ inputs.FILE }} context: ${{ inputs.CONTEXT }} # cannot use multiple platforms with `load`, build a single arch image for validation purposes in CI diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 9aca106e..2165e006 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -118,15 +118,15 @@ runs: done shell: bash - # - name: Run Tests - # if: inputs.RUN_TESTS != 'false' - # run: | - # bundle exec rspec -f j -o tmp/rspec_results.json -f p - # shell: bash + - name: Run Tests + if: inputs.RUN_TESTS != 'false' + run: | + bundle exec rspec -f j -o tmp/rspec_results.json -f p + shell: bash - # - name: RSpec Report - # if: always() - # uses: SonicGarden/rspec-report-action@v3 - # with: - # token: ${{ env.GITHUB_TOKEN }} - # json-path: tmp/rspec_results.json + - name: RSpec Report + if: always() + uses: SonicGarden/rspec-report-action@v3 + with: + token: ${{ env.GITHUB_TOKEN }} + json-path: tmp/rspec_results.json From bf67306a9e2a49bc56eb2a23eadf4fdadb080e37 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:24:37 -0700 Subject: [PATCH 35/38] reduce changes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8736de3..3f39c89d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -203,7 +203,7 @@ jobs: CHECK: name: CI - uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/debug-container-test + uses: signalwire/actions-template/.github/workflows/ci-check.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} @@ -241,7 +241,7 @@ jobs: BUILD: name: BUILD needs: CHECK - uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/debug-container-test + uses: signalwire/actions-template/.github/workflows/ci-build.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From cd67dd12df957dd39b73603283b0c93f5961a344 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:24:54 -0700 Subject: [PATCH 36/38] reduce changes --- .github/workflows/ci-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index ca4fb5d2..ad7c6039 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -152,7 +152,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: ryanwi/debug-container-test + ref: main path: actions - name: Retrieve Secrets from HashiCorp Vault From 6b045c065a94cb9c33197f2ad31858f47abe3959 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:25:02 -0700 Subject: [PATCH 37/38] reduce changes --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 988b7b00..083445bf 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -225,7 +225,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: ryanwi/debug-container-test + ref: main path: actions - uses: ./actions/.github/actions/gpg From a7e0b1ba984d04023ca275fe982d7c632956b06d Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 1 May 2024 16:25:22 -0700 Subject: [PATCH 38/38] reduce changes --- .github/actions/test-ruby/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 2165e006..1bf14d69 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -119,7 +119,6 @@ runs: shell: bash - name: Run Tests - if: inputs.RUN_TESTS != 'false' run: | bundle exec rspec -f j -o tmp/rspec_results.json -f p shell: bash