Skip to content

try some debug in screenshot #36

try some debug in screenshot

try some debug in screenshot #36

name: Take Screenshot
on:
push:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
DISPLAY: :99
SLINT_FULLSCREEN: 1
RUST_LOG: debug
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Cache cargo bin
uses: actions/cache@v2
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-foo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-foo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-foo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-foo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --release
- name: Run and take screenshot
run: |
cargo run --release > cargo.log 2>&1 &
sleep 10
cat cargo.log
osascript -e 'tell application "System Events" to tell process "infoskjerm" to set frontmost to true'
osascript -e 'delay 10'
WINDOW_ID=$(osascript -e 'tell application "System Events" to return id of window of process "infoskjerm"')
echo "Window ID: $WINDOW_ID" # Print the window ID
screencapture -l$WINDOW_ID screenshot.png
- name: Commit and push screenshot
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add screenshot" -a
git push