name: continuous integration
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
check:
name: check
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, nightly]
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: cargo
uses: actions-rs/cargo@v1
with:
command: check
args: --all --bins --examples --tests --all-features
test:
name: test suite
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- 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: test
uses: actions-rs/cargo@v1
with:
command: test
args: "--all --features live-tests"
env:
DISPLAY: ":99"
- name: tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
args: "--verbose --features live-tests"
env:
DISPLAY: ":99"
- name: archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt
- name: cargo
uses: actions-rs/cargo@v1
- name: fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: "-- --check"
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: clippy
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: "-- -A clippy::tabs-in-doc-comments -D warnings"