From 08d4662f6f067e8bd8867df182dd32eadc09464e Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 1 Jun 2024 09:36:50 -0700 Subject: [PATCH] squash --- .github/actions/docker/action.yml | 6 +++++- .github/actions/test-ruby/action.yml | 5 ----- .github/workflows/ci-build.yml | 7 ++++++- .github/workflows/ci.yml | 7 ++++++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 6676f221..85eccc72 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -47,6 +47,10 @@ inputs: default: 'true' description: 'Whenever the container should be tested on pr.' required: false + CONTAINER_TEST_RUN_OPTIONS: + default: '' + description: 'Custom options for the docker run command that executes the test' + required: false CONTAINER_TEST_COMMAND: default: '' description: 'A custom command to test the docker container.' @@ -145,7 +149,7 @@ 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 ${{ inputs.CONTAINER_TEST_RUN_OPTIONS }} ${{ fromJSON(steps.meta.outputs.json).tags[0] }} sleep 20 docker ps docker logs test 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 083445bf..35aee999 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -77,6 +77,10 @@ on: type: boolean default: true description: 'Whenever the container should be tested on pr.' + CONTAINER_TEST_RUN_OPTIONS: + type: string + default: '' + description: 'Custom options for the docker run command that executes the test' CONTAINER_TEST_COMMAND: type: string default: '' @@ -225,7 +229,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: main + ref: ryanwi/container-test-run-options path: actions - uses: ./actions/.github/actions/gpg @@ -273,6 +277,7 @@ jobs: IMAGE_REPO: ${{ inputs.IMAGE_REPO }} BUILD_ARGS: ${{ inputs.BUILD_ARGS }} CONTAINER_TEST: ${{ inputs.CONTAINER_TEST }} + CONTAINER_TEST_RUN_OPTIONS: ${{ inputs.CONTAINER_TEST_RUN_OPTIONS }} CONTAINER_TEST_COMMAND: ${{ inputs.CONTAINER_TEST_COMMAND }} OUTPUT_TAG_INDEX: ${{ inputs.OUTPUT_TAG_INDEX }} CACHE_FROM: ${{ inputs.CACHE_FROM }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cc273c3..87c64678 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_RUN_OPTIONS: + type: string + default: '' + description: 'Custom options for the docker run command that executes the test' CONTAINER_TEST_COMMAND: type: string default: '' @@ -241,7 +245,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@ryanwi/container-test-run-options with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} @@ -255,6 +259,7 @@ jobs: PLATFORMS: ${{ inputs.PLATFORMS }} CONTAINER_SCAN: ${{ inputs.CONTAINER_SCAN }} CONTAINER_TEST: ${{ inputs.CONTAINER_TEST }} + CONTAINER_TEST_RUN_OPTIONS: ${{ inputs.CONTAINER_TEST_RUN_OPTIONS }} CONTAINER_TEST_COMMAND: ${{ inputs.CONTAINER_TEST_COMMAND }} RUNNER: ${{ inputs.RUNNER }} TAG: ${{ inputs.TAG }}