-
Notifications
You must be signed in to change notification settings - Fork 4
140 lines (111 loc) · 4.5 KB
/
rust.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
override: true
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
build-nostd:
runs-on: ubuntu-latest
needs:
- formatting
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: thumbv7em-none-eabihf
override: true
- name: Build no_std
run: cargo build --verbose --target thumbv7em-none-eabihf -Z avoid-dev-deps
build:
runs-on: ubuntu-latest
needs:
- formatting
strategy:
matrix:
include:
- name: stable
rust: stable
- name: beta
rust: beta
- name: nightly
rust: nightly
- name: msrv
rust: 1.61.0
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt
- name: Install dependencies
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev imagemagick
- name: Build
run: cargo build --verbose
- name: Run tests
run: |
cargo test --lib
cargo test --lib --no-default-features
cargo test --lib --all-features
- name: Build examples
run: cargo build --examples --verbose
- name: Check example images
run: |
mkdir -p ./target/screenshots
EG_SIMULATOR_DUMP="./target/screenshots/alignment-horizontal.png" cargo run --example alignment-horizontal
compare -metric AE ./assets/alignment-horizontal.png ./target/screenshots/alignment-horizontal.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/alignment-vertical.png" cargo run --example alignment-vertical
compare -metric AE ./assets/alignment-vertical.png ./target/screenshots/alignment-vertical.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/paragraph_spacing.png" cargo run --example paragraph_spacing
compare -metric AE ./assets/paragraph_spacing.png ./target/screenshots/paragraph_spacing.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/plugin-ansi.png" cargo run --example plugin-ansi --features=ansi
compare -metric AE ./assets/plugin-ansi.png ./target/screenshots/plugin-ansi.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/plugin-tail.png" cargo run --example plugin-tail
compare -metric AE ./assets/plugin-tail.png ./target/screenshots/plugin-tail.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/special-characters.png" cargo run --example special-characters
compare -metric AE ./assets/special-characters.png ./target/screenshots/special-characters.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/special-characters-tabs.png" cargo run --example special-characters-tabs --features=ansi
compare -metric AE ./assets/special-characters-tabs.png ./target/screenshots/special-characters-tabs.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/styles-plugin.png" cargo run --example styles-plugin --features=plugin
compare -metric AE ./assets/styles-plugin.png ./target/screenshots/styles-plugin.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/styles-static.png" cargo run --example styles-static
compare -metric AE ./assets/styles-static.png ./target/screenshots/styles-static.png result.png
EG_SIMULATOR_DUMP="./target/screenshots/whitespace_control.png" cargo run --example whitespace_control
compare -metric AE ./assets/whitespace_control.png ./target/screenshots/whitespace_control.png result.png
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
override: true
- name: Check doc links
run: |
cargo doc --color=never &> ./out
cat ./out
! grep "^warning:" ./out