Skip to content

Commit

Permalink
add workflow "OS Testing with Configurable tmate"
Browse files Browse the repository at this point in the history
  • Loading branch information
backwind1233 committed Aug 22, 2024
1 parent a45f42d commit 00fc90c
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/tmate-for-multi-os-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: OS Testing with Configurable tmate

on:
workflow_dispatch:
inputs:
os:
type: choice
description: 'Select the operating system'
options:
- ubuntu-latest
- macos-latest
default: 'ubuntu-latest'
debug_enabled:
type: boolean
description: 'Enable tmate debugging session'
required: false
default: true
tmate_timeout:
type: choice
description: 'tmate session timeout'
options:
- 1h
- 6h
- 1d
- 7d
default: '1h'

jobs:
test:
name: ${{ (github.event.inputs.os == 'macos-latest' && 'macOS' || 'Ubuntu') }} OS Testing
runs-on: ${{ github.event.inputs.os }}

steps:
- uses: actions/checkout@v2

- name: Print OS info
run: |
echo "Running on ${{ github.event.inputs.os }}"
echo "Detailed OS Information:"
if [ "$RUNNER_OS" == "Linux" ]; then
echo "OS: Ubuntu"
uname -a
lsb_release -a
cat /etc/os-release
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "OS: macOS"
sw_vers
uname -a
else
echo "Unexpected OS"
uname -a
fi
# Add your test steps here
- name: Run tests
run: |
echo "Add your test commands here"
# Add your actual test commands here
# Optional: Add more steps as needed for your specific testing requirements

- name: Setup tmate session
if: ${{ github.event.inputs.debug_enabled == 'true' }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
timeout-minutes: ${{ fromJSON('{"1h":60, "6h":360, "1d":1440, "7d":10080}')[github.event.inputs.tmate_timeout] }}

0 comments on commit 00fc90c

Please sign in to comment.