From d3139af09057781b67b8036bb4c988928a57e4a0 Mon Sep 17 00:00:00 2001 From: Konstantin Gribov Date: Tue, 26 Jan 2021 21:20:55 +0300 Subject: [PATCH] Use GitHub Actions instead of TravisCI --- .github/workflows/ci.yml | 114 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 38 ------------- 2 files changed, 114 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..99f4df0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,114 @@ +name: CI + +on: + - push + - pull_request + +env: + CARGO_TERM_COLOR: always + +jobs: + check: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - 1.42 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - uses: Swatinem/rust-cache@v1 + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - uses: Swatinem/rust-cache@v1 + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt --all -- --check + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: Swatinem/rust-cache@v1 + - name: Run cargo clippy + uses: actions-rs/clippy@master + with: + args: --all-features + + build-linux: + name: Build on Linux with Rust ${{ matrix.rust }} + runs-on: ubuntu-latest + needs: + - check + - fmt + strategy: + matrix: + rust: + - stable + - 1.42 + - beta + - nightly + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - uses: Swatinem/rust-cache@v1 + - name: Install libsmbclient-dev & pkg-config + run: sudo apt -y install libsmbclient-dev pkg-config + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build --verbose + + build-macos: + name: Build on MacOS with Rust ${{ matrix.rust }} + runs-on: macos-latest + needs: + - build-linux + strategy: + matrix: + rust: + - stable + - 1.42 + - beta + - nightly + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - uses: Swatinem/rust-cache@v1 + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build --verbose diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a6dbe73..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -dist: trusty -sudo: false - -language: rust -cache: cargo -rust: -- stable -- beta -- nightly -matrix: - allow_failures: - - rust: nightly - -env: - global: - - LIBCLANG_PATH="/usr/lib/llvm-3.9/lib" - - PKG_CONFIG_PATH="/usr/lib/*/pkgconfig/" - -addons: - apt: - sources: - - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main' - key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key' - - packages: - - libsmbclient-dev - - pkg-config - - clang-3.9 - - libclang-3.9-dev - - llvm-3.9-dev - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/ab0b5f048023444e2080 - on_success: change - on_failure: always - on_start: never