-
-
Notifications
You must be signed in to change notification settings - Fork 21
95 lines (76 loc) · 2.46 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build Wayshot
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: |
rm Cargo.lock
cargo build --release
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check formatting
run: |
cargo fmt -- --check
documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check docs
run: |
sudo apt update
sudo apt install --no-install-recommends scdoc
for file in $(find . -type f -iwholename "./docs/*.scd"); do scdoc < $file > /dev/null; done
benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
# install sway and flamegraph dependencies
sudo apt update
sudo apt install --no-install-recommends -y sway \
linux-tools-common linux-tools-generic linux-tools-`uname -r`
# install flamegraph-rs
cargo install flamegraph
# install hyperfine
wget https://github.com/sharkdp/hyperfine/releases/download/v1.16.1/hyperfine_1.16.1_amd64.deb
sudo dpkg -i hyperfine_1.16.1_amd64.deb
- name: Run benchmarks
run: |
export XDG_RUNTIME_DIR=/tmp
export WLR_BACKENDS=headless
export WLR_LIBINPUT_NODEVICES=1
export WLR_RENDERER_ALLOW_SOFTWARE=1
export SWAYSOCK=/tmp/swaysock
# file where we'll store $WAYLAND_DISPLAY
export SWAY_STARTUP=/tmp/sway_startup
sway -c ./test/swayconfig -d &
export SWAY_PID=$!
# TODO: maybe find a more elegant way to wait for sway to start
sleep 10
# load WAYLAND_DISPLAY from the file we stored it in, as defined
# in the test sway config
read wayland_display < "$SWAY_STARTUP"
export WAYLAND_DISPLAY="$wayland_display"
sudo sh -c 'echo -1 >/proc/sys/kernel/perf_event_paranoid'
cargo flamegraph --release -- --log-level debug - > /dev/null
hyperfine --export-json hyperfine.json "cargo run --release -- --log-level debug - > /dev/null"
- name: Collect benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
flamegraph.svg
perf.data
hyperfine.json