-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (53 loc) · 1.72 KB
/
ci.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
name: CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install everything that is needed
run: |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y xserver-xorg-core xserver-xorg xorg xvfb bspwm
sudo apt-get install zathura
- name: Add config for bspwm and sxhkd
run: |
mkdir -p $HOME/.config/bspwm
mkdir -p $HOME/.config/sxhkd
sudo cp /usr/share/doc/bspwm/examples/bspwmrc $HOME/.config/bspwm/bspwmrc
sudo cp /usr/share/doc/bspwm/examples/sxhkdrc $HOME/.config/sxhkd/sxhkdrc
sudo chmod 755 $HOME/.config/bspwm/bspwmrc
sudo chmod 755 $HOME/.config/sxhkd/sxhkdrc
- name: Start xserver and run bspwm
run: |
# https://stackoverflow.com/questions/63125480/running-a-gui-application-on-a-ci-service-without-x11
sudo xvfb-run -a --server-num=99 --auth-file=$HOME/.Xauthority bspwm &
sleep 5
sudo chmod 777 $HOME/.Xauthority
- name: Open window
run: |
export DISPLAY=:99
zathura &
- name: Update rustup
run: rustup update stable && rustup default stable
- name: Build
run: cargo build --verbose
- name: Build tests
run: cargo test --no-run --verbose
- name: Run tests
run: |
sleep 3
sudo chmod 777 /tmp/bspwm*
sleep 1
export DISPLAY=:99
export IXWINDOW_CONFIG_PATH=$PWD/examples/ixwindow.toml
cargo test --no-fail-fast --verbose -- --test-threads=1
- name: Run clippy
run: cargo clippy
- name: Run formatter
run: cargo fmt --check