Skip to content

Merge pull request #164 from embedded-graphics/renderer #1014

Merge pull request #164 from embedded-graphics/renderer

Merge pull request #164 from embedded-graphics/renderer #1014

Workflow file for this run

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