dubious perf tweaks (#25) #82
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 | |
paths: | |
- 'src/**' | |
- 'img/**' | |
- 'ui/**' | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
DISPLAY: :99 | |
RUST_LOG: debug | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache cargo build | |
uses: actions/cache@v2 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-foo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb libxkbcommon-x11-0 | |
- name: Start Xvfb | |
run: Xvfb :99 -screen 0 1080x1900x24 & | |
- name: Build | |
run: cargo build --release --features selfie | |
- name: Run and take screenshot | |
run: | | |
cargo run --release --features selfie & | |
sleep 5 | |
- name: Commit and push screenshot | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add screenshot.png | |
git commit -m "Add updated screenshot" | |
git push | |
- name: Upload screenshots as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: screenshot | |
path: | | |
screenshot.png |