diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d2e8979f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,114 @@ +name: Continuous Integration + +on: + pull_request: + paths: + - "**.rs" + - "Cargo.toml" + - "Cargo.lock" + +jobs: + fmt: + name: Source formatting check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt + + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + + check: + name: Compilation check + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + rust: + - stable + - beta + - nightly + - 1.41.0 + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + + clippy: + name: Lint check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + + - name: Run lints + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + + ci-crate: + name: CI crate check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + + - name: Run ci crate + uses: actions-rs/cargo@v1 + with: + command: run + args: -p ci + + crate-example: + name: Crate example check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + + - name: Run crate example + uses: actions-rs/cargo@v1 + with: + command: run + args: --example default diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index af8f18d7..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: rust -sudo: false -rust: - - 1.31.0 - - stable - - beta - - nightly -before_script: - - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH -script: - - if [ "${MINIMAL_VERSIONS}" = "y" ]; then cargo update -Z minimal-versions; fi - - cargo run -p ci - - cargo run --example default -after_success: - - travis-cargo --only nightly doc-upload - -matrix: - include: - - rust: nightly - env: MINIMAL_VERSIONS=y - -notifications: - email: -on_success: never diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 00000000..033080c4 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +1.41.0