-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.31 KB
/
integration-tests.yaml
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
name: Integration Tests
on:
push:
env:
CARGO_TERM_COLOR: always
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Install Gnome and friends
run: |
sudo apt update
sudo apt install ubuntu-desktop -y
- name: Prepare Scripts
run: |
mkdir -p $HOME/.config/dark-mode-daemon/scripts/
cat <<EOF > $HOME/.config/dark-mode-daemon/scripts/executable.sh
#!/usr/bin/env bash
echo "scripts ran" >> $HOME/protocol.txt
EOF
chmod +x $HOME/.config/dark-mode-daemon/scripts/executable.sh
- name: Run Daemon
run: cargo run --verbose -- daemon &
- name: Switch Mode
run: gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
- name: Assert Scripts Did Ran
run: |
sleep 5
# Once when starting the scripts
echo "scripts ran" >> $HOME/expected.txt
# Once for when we toggled the mode
echo "scripts ran" >> $HOME/expected.txt
diff $HOME/expected.txt $HOME/protocol.txt
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Prepare Scripts
run: |
mkdir -p $HOME/.config/dark-mode-daemon/scripts/
cat <<EOF > $HOME/.config/dark-mode-daemon/scripts/executable.sh
#!/usr/bin/env bash
echo "scripts ran" >> $HOME/protocol.txt
EOF
chmod +x $HOME/.config/dark-mode-daemon/scripts/executable.sh
- name: Run Daemon
run: cargo run --verbose -- daemon &
- name: Switch Mode
run: osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to not dark mode'
- name: Assert Scripts Did Ran
run: |
sleep 5
# Once when starting the scripts
echo "scripts ran" >> $HOME/expected.txt
# Once for when we toggled the mode
echo "scripts ran" >> $HOME/expected.txt
diff $HOME/expected.txt $HOME/protocol.txt
# windows:
# runs-on: windows-latest
# # TODO: Continue
# steps:
# - uses: actions/checkout@v4
# - name: Build
# run: cargo build --verbose