ci: switch to github actions

This commit is contained in:
PoiScript 2020-04-14 18:12:09 +08:00
parent c2849d05fb
commit c6f0c98d87
2 changed files with 39 additions and 23 deletions

39
.github/workflows/rust.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Rust
on:
pull_request:
push:
branches:
- master
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run rustfmt
run: cargo fmt -- --check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Cache target/
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run Test
run: cargo test --all-features

View file

@ -1,23 +0,0 @@
language: rust
rust:
- stable
- nightly
matrix:
allow_failures:
- rust: nightly
cache: cargo
before_script:
- rustup component add rustfmt-preview
script:
- cargo fmt --all -- --check
- cargo test --all-features
notifications:
email:
on_failure: change
on_success: change