From beb2931787445e499d929a44c3a513a6271f5886 Mon Sep 17 00:00:00 2001 From: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:12:24 -0700 Subject: [PATCH 1/2] replace debug boolean with dropdown Instead of halting every step in CI when debugging via tmate is enabled, allow the actor to select which step they want to debug. Previously, if a dev was trying to debug the test step, for example, they would have to first tmate into the build step and close the session to allow the build to proceed. Ref #74 --- .github/workflows/build.yaml | 2 +- .github/workflows/cypress.yaml | 4 ++-- .github/workflows/deploy.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/test.yaml | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6e8c80b..3f87fac 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -92,7 +92,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'build' }} with: limit-access-to-actor: true - name: Retag action for base diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index ec26375..2d7cbc8 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -82,7 +82,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'cypress' }} with: limit-access-to-actor: true - name: Pull image to prevent build @@ -131,4 +131,4 @@ jobs: uses: mikepenz/action-junit-report@v3 if: always() # always run even if the previous step fails with: - report_paths: 'cypress/results/results-*.xml' \ No newline at end of file + report_paths: 'cypress/results/results-*.xml' diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0da3316..71d6424 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -111,7 +111,7 @@ jobs: token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'deploy' }} with: limit-access-to-actor: true - name: Do deploy with solr image diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e8aefd6..f3514ba 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -81,7 +81,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'lint' }} with: limit-access-to-actor: true - name: Run Rubocop diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a7b5c6c..8d99f68 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -116,11 +116,6 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} - with: - limit-access-to-actor: true - name: Start containers run: >- cd ${{ inputs.subdir }}; @@ -140,6 +135,11 @@ jobs: cd ${{ inputs.subdir }}; docker compose exec -T web sh -c "${{ inputs.setup_db_cmd }}" + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'test' }} + with: + limit-access-to-actor: true - name: Run Specs id: run-specs env: From 95e1e715e38a410657c4dbc2e89111a2c3b7a6f6 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 12 Sep 2024 09:37:41 -0700 Subject: [PATCH 2/2] remove test.yaml change --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8d99f68..add1a82 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -116,6 +116,11 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'test' }} + with: + limit-access-to-actor: true - name: Start containers run: >- cd ${{ inputs.subdir }}; @@ -135,11 +140,6 @@ jobs: cd ${{ inputs.subdir }}; docker compose exec -T web sh -c "${{ inputs.setup_db_cmd }}" - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'test' }} - with: - limit-access-to-actor: true - name: Run Specs id: run-specs env: