|
|
|
name: Continuous Integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: main
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test Suite
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-latest
|
|
|
|
- ubuntu-latest
|
|
|
|
- ubuntu-20.04
|
|
|
|
rust: [stable]
|
|
|
|
include:
|
|
|
|
- os: macos-latest
|
|
|
|
artifact_prefix: macos
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
binary_postfix: ''
|
|
|
|
- os: ubuntu-latest
|
|
|
|
artifact_prefix: linux
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
binary_postfix: ''
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
artifact_prefix: linux-musl
|
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
binary_postfix: ''
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Installing Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Installing needed macOS dependencies
|
|
|
|
if: matrix.os == 'macos-latest'
|
|
|
|
run: brew install openssl@1.1
|
|
|
|
|
|
|
|
- name: Installing needed Ubuntu dependencies
|
|
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-20.04'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
args: --target ${{ matrix.target }}
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
args: --target ${{ matrix.target }}
|
|
|
|
|
|
|
|
# bench:
|
|
|
|
# name: Benchmarks
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - uses: actions-rs/toolchain@v1
|
|
|
|
# with:
|
|
|
|
# toolchain: stable
|
|
|
|
# profile: minimal
|
|
|
|
# override: true
|
|
|
|
# # These dependencies are required for `clipboard`
|
|
|
|
# - run: sudo apt-get install -y -qq libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
|
|
|
# - uses: actions-rs/cargo@v1
|
|
|
|
# with:
|
|
|
|
# command: bench
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
name: Rustfmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
components: rustfmt
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: Clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
components: clippy
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: -- -D warnings
|