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' }}