Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing
Browse files Browse the repository at this point in the history
MathiasReker committed Jan 1, 2025
1 parent 891a438 commit 8326920
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/terminal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Run PHP Script with Asciinema

on:
push:
branches:
- develop

pull_request:
branches:
- '*'

jobs:
run_script:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set Up PHP Environment
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: mbstring

- name: Install Pipe Viewer (pv)
run: |
sudo apt install -y pv
pv --version
- name: Install Asciinema
run: |
sudo apt install -y asciinema
- name: Create script.sh
run: |
cat > script.sh <<EOF
#!/bin/bash
echo "Hello, World!" | pv -qL 10
sleep 1
echo "This is a scripted session." | pv -qL 10
sleep 1
echo "Listing files:" | pv -qL 10
sleep 0.5
ls | pv -qL 10
sleep 1
echo "Goodbye!" | pv -qL 10
EOF
chmod +x script.sh
- name: Make script executable
run: chmod +x script.sh

- name: Record the script execution
run: |
asciinema rec --command="./script.sh" --quiet --overwrite output.cast
#continue-on-error: true # To avoid action failure if no terminal output is captured.

- name: Build Docker image for asciinema-agg
run: |
git clone https://github.com/asciinema/agg.git
cd agg
docker build -t agg .
- name: Convert .cast to .gif using Docker
run: |
docker run --rm -it -v $PWD:/data agg /data/output.cast /data/demo.gif
- name: Upload the Asciinema recording and gif to artifacts
uses: actions/upload-artifact@v4
with:
name: asciinema-recording-and-gif
path: |
output.cast
demo.gif

0 comments on commit 8326920

Please sign in to comment.