From 2667e5d0a4da1db1df63a6b9677e9af6bbe500a5 Mon Sep 17 00:00:00 2001 From: Joe Fitzgerald Date: Fri, 17 Nov 2023 11:44:58 -0700 Subject: [PATCH] add ability to debug ci Signed-off-by: Joe Fitzgerald --- .github/workflows/go.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f40960d..b544b93 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,5 +1,14 @@ name: Build and Test -on: [push, pull_request] +on: + push: + pull_request: + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false jobs: build: name: Build and Test @@ -10,15 +19,17 @@ jobs: os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v4 - - name: Set up Go uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - - - name: Build and Test + # Enable tmate debugging of manually-triggered workflows if the input option was provided + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + - name: Build and Test (Linux and macOS) run: ./scripts/ci.sh - if: ${{ matrix.os == 'ubuntu-latest' }} - - name: Build and Test + if: ${{ matrix.os != 'windows-latest' }} + - name: Build and Test (Windows) run: .\scripts\ci.ps1 if: ${{ matrix.os == 'windows-latest' }}