try xvnc #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Take Screenshot | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
DISPLAY: :0 | |
SLINT_FULLSCREEN: 1 | |
RUST_LOG: debug | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache cargo bin | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/bin | |
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v2 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb x11vnc scrot imagemagick libxkbcommon-x11-0 | |
- name: Start Xvfb | |
run: | | |
xvnc -geometry 1024x768 -depth 16 :10 > /dev/null 2>&1 & | |
sleep 5 | |
cargo build --release | |
cargo run --release > cargo.log 2>&1 & | |
sleep 30 | |
cat cargo.log | |
scrot 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 screenshot.png | |
git commit -m "Add screenshot" -a | |
git push |