2020-06-28 06:16:38 +03:00
name : CI
on :
pull_request :
push :
branches :
- master
2021-02-11 01:00:37 +03:00
- staging
- trying
2020-12-17 19:23:45 +03:00
paths-ignore :
- 'docs/**'
- 'documentation/**'
2020-06-28 06:16:38 +03:00
env :
RUST_BACKTRACE : 1
jobs :
style :
name : Check Style
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v1
- name : Install Rust
uses : actions-rs/toolchain@v1
with :
profile : minimal
toolchain : nightly
override : true
components : rustfmt
- name : cargo fmt --check
uses : actions-rs/cargo@v1
with :
command : fmt
args : --all -- --check
2020-12-01 01:06:46 +03:00
clippy :
name : Clippy
runs-on : ubuntu-latest
env :
RUSTFLAGS : -Dwarnings
steps :
- name : Checkout
uses : actions/checkout@v2
2021-02-02 07:15:57 +03:00
- name : Install Rust
2020-12-01 01:06:46 +03:00
uses : actions-rs/toolchain@v1
with :
profile : minimal
2021-02-02 07:15:57 +03:00
toolchain : stable
2020-12-01 01:06:46 +03:00
override : true
components : clippy
- name : Check examples
uses : actions-rs/cargo@v1
with :
command : clippy
args : --examples --all
- name : Check examples with all features on stable
uses : actions-rs/cargo@v1
with :
command : clippy
args : --examples --all-features --all
2021-02-02 07:15:57 +03:00
- name : Check benchmarks on nightly
uses : actions-rs/cargo@v1
with :
command : clippy
args : --all-features --examples --all --benches
2020-12-01 01:06:46 +03:00
2021-07-14 23:26:32 +03:00
test-package-linux :
2021-07-14 23:55:01 +03:00
name : Test Package Linux
2020-09-14 07:53:53 +03:00
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v2
2021-07-14 23:26:32 +03:00
- name : Install Rust Stable
2020-09-14 07:53:53 +03:00
uses : actions-rs/toolchain@v1
with :
profile : minimal
2021-07-14 23:26:32 +03:00
toolchain : stable
override : true
- name : Install cargo-all-features
run : |
cargo install cargo-all-features
- name : Test
run : |
cd package
cargo test-all-features
test-package-windows :
2021-07-14 23:55:01 +03:00
name : Test Package Windows
2021-07-14 23:26:32 +03:00
runs-on : windows-latest
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Install Rust Stable
uses : actions-rs/toolchain@v1
with :
profile : minimal
toolchain : stable
2020-09-14 07:53:53 +03:00
override : true
- name : Install cargo-all-features
run : |
cargo install cargo-all-features
- name : Test
run : |
2020-09-18 21:39:26 +03:00
cd package
2020-09-14 07:53:53 +03:00
cargo test-all-features
2021-07-14 23:55:01 +03:00
test-package-macos :
name : Test Package macOS
runs-on : macos-latest
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Install Rust Stable
uses : actions-rs/toolchain@v1
with :
profile : minimal
toolchain : stable
override : true
- name : Install cargo-all-features
run : |
cargo install cargo-all-features
- name : Test
run : |
cd package
cargo test-all-features
test-package-macos_m1 :
name : Test Package macOS M1
runs-on : macos-latest
steps :
- name : Xcode Select
uses : devbotsxyz/xcode-select@v1.1.0
- name : Checkout
uses : actions/checkout@v2
- name : Install Rust
uses : actions-rs/toolchain@v1
with :
profile : minimal
target : aarch64-apple-darwin
toolchain : stable
override : true
components : rustfmt
- name : Install cargo-all-features
run : |
SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \
cargo install cargo-all-features
- name : Test
run : |
SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \
cd package && cargo test-all-features
2021-03-16 08:53:26 +03:00
codecov :
name : Code Coverage
runs-on : ubuntu-latest
2021-07-14 23:55:01 +03:00
env :
RUSTC_BOOTSTRAP=1
2021-03-16 08:53:26 +03:00
steps :
- name : Checkout
uses : actions/checkout@v1
- name : Install Rust
uses : actions-rs/toolchain@v1
with :
profile : minimal
2021-07-14 23:55:01 +03:00
toolchain : stable
2021-03-16 08:53:26 +03:00
override : true
components : rustfmt
- name : Install dependencies for code coverage
run : |
sudo apt-get update
sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
- name : Generate coverage report
run : |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
tar xzf master.tar.gz
cd kcov-master
mkdir build && cd build
cmake .. && make
make install DESTDIR=../../kcov-build
cd ../..
rm -rf kcov-master
for file in target/debug/deps/*-*; do if [[ "$file" != *\.* ]]; then mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --exclude-region='@kcov_skip(start):@kcov_skip(end)' --verify "target/cov/$(basename $file)" "$file"; fi done
- name : Upload coverage to Codecov
uses : codecov/codecov-action@v1
with :
github-token : ${{ secrets.GITHUB_TOKEN }}
token : ${{ secrets.CODECOV_TOKEN }}