Skip to content

Commit

Permalink
Add tmate actions to debug GitHub CI failures (#776)
Browse files Browse the repository at this point in the history
Also, restrict GitHub CI runs on pushes/pull requests on `development`
and `main` branches.
  • Loading branch information
thilinarmtb authored Nov 21, 2024
1 parent cca2188 commit 75b49c7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@ name: Build

on:
push:
branches: [development, main]
paths-ignore:
- 'README.md'
- 'INSTALL.md'
- 'docs/**'
pull_request:
branches: [development, main]
paths-ignore:
- 'README.md'
- 'INSTALL.md'
- 'docs/**'
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: true

jobs:
run:
Expand Down Expand Up @@ -71,6 +80,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3.13
if: ${{ inputs.debug_enabled }}

- name: add oneAPI to apt
if: ${{ matrix.useoneAPI }}
shell: bash
Expand Down Expand Up @@ -172,3 +185,7 @@ jobs:
- name: Upload code coverage
if: ${{ matrix.OCCA_COVERAGE }}
run: bash <(curl --no-buffer -s https://codecov.io/bash) -x "${GCOV}"

- name: Block to allow inspecting failures
run: sleep 1800
if: ${{ failure() && inputs.debug_enabled }}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ $ occa info
========+======================+=================================
```

## Debug

### GitHub CI failures

We use [tmate action](https://github.com/mxschmitt/action-tmate) for debugging GitHub CI workflows with a [manually triggered debug](https://github.com/mxschmitt/action-tmate?tab=readme-ov-file#manually-triggered-debug) event.
See [GitHub docs](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow) on how to initiate a manual debug run (make sure to check the `Run the build with tmate debugging enabled` box).

## Community

### Support
Expand Down

0 comments on commit 75b49c7

Please sign in to comment.