Skip to content

Commit

Permalink
Merge pull request datalad#364 from candleindark/setup-tmate
Browse files Browse the repository at this point in the history
Set up Tests GitHub Action workflow with tmate debugging
  • Loading branch information
candleindark authored May 3, 2024
2 parents b6dd1b4 + 9a08e32 commit 7ede3ae
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
branches:
- master
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:
test:
Expand Down Expand Up @@ -41,8 +48,14 @@ jobs:
run: dotenv -f env.test list >> "$GITHUB_ENV"
- name: Start services with Docker Compose
run: docker compose -f docker-compose.test.yml up -d
# 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 }}
# Run tests if the workflow is not triggered for debugging
- name: Run tests with Coverage
run: python -m pytest -s -v --cov=. --cov-report=xml
if: ${{ github.event_name != 'workflow_dispatch' || !inputs.debug_enabled }}
- name: Stop services provided by Docker Compose
run: docker compose -f docker-compose.test.yml down
- name: mypy check
Expand Down

0 comments on commit 7ede3ae

Please sign in to comment.