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
name: build
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: install X11 dependencies
run: |
sudo apt-get update
sudo apt-get install --allow-unauthenticated -y -qq libxcb-shape0-dev libxcb-xfixes0-dev libx11-xcb-dev
- name: install xvfb
run: |
sudo apt update
sudo apt-get install --allow-unauthenticated -y -qq xvfb
- name: setup virtual display
if: ${{ runner.os }} == "Linux"
run: |
sudo Xvfb :99 -screen 0 800x600x24 &
- name: build
run: cargo build --verbose
- name: tests
run: cargo test --verbose --features live-tests
env:
DISPLAY: ":99"
- name: cargo-make
uses: davidB/rust-cargo-make@v1
with:
version: "latest"
- name: coverage
run: cargo make tarpaulin -- --features -live-tests
env:
DISPLAY: ":99"
# References
#
# https://en.wikipedia.org/wiki/Xvfb
#
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
#
# https://github.com/actions-rs
# https://github.com/actions-rs/awesome-rust-actions
# https://github.com/actions-rs/grcov
# https://github.com/actions-rs/meta
# https://github.com/actions-rs/tarpaulin
# https://github.com/actions-rs/toolchain
# https://github.com/actions/checkout
# https://github.com/actions/upload-artifact
# https://github.com/codecov/codecov-action
# https://github.com/marketplace/actions/rust-cargo-make
# https://github.com/davidB/rust-cargo-make
# https://github.com/orhun/kmon/blob/master/.github/workflows/cd.yml
# https://github.com/quininer/x11-clipboard
# https://github.com/sagiegurari/cargo-make
# https://github.com/z/snaps/blob/32ea84d20880f576d98c6e75a1f3fde030a44566/.github/workflows/ci.yml
# https://github.com/Lyceum/Lyceum.jl/blob/50bd005fd2a72075301d4fb32c24389cac07c529/.github/workflows/ci.yml#L59
# https://github.com/Meemaw/Insight/blob/a6b1ec0f4fbc6d76e30817ee0e3c9e71e2b0bf37/.github/workflows/frontend:browser:tracking.yml