diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..3887387 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,67 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + +jobs: + build: + runs-on: ${{ matrix.os || 'ubuntu-latest' }} + + strategy: + matrix: + name: + - linux/stable + - linux/beta + - macOS/stable + - windows/stable-x86_64-msvc + - windows/stable-i686-msvc + - windows/stable-x86_64-gnu + - windows/stable-i686-gnu + + include: + - name: linux/beta + rust: beta + - name: macOS/stable + os: macOS-latest + - name: windows/stable-x86_64-msvc + os: windows-latest + target: x86_64-pc-windows-msvc + - name: windows/stable-i686-msvc + os: windows-latest + target: i686-pc-windows-msvc + - name: windows/stable-x86_64-gnu + os: windows-latest + rust: stable-x86_64-pc-windows-gnu + target: x86_64-pc-windows-gnu + - name: windows/stable-i686-gnu + os: windows-latest + rust: stable-i686-pc-windows-gnu + target: i686-pc-windows-gnu + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust || 'stable' }} + target: ${{ matrix.target }} + profile: minimal + override: true + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + + - name: Run tests + uses: actions-rs/cargo@v1 + with: + command: test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b74d2a5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -# required because of tarpaulin dependency -sudo: required - -language: rust - -matrix: - fast_finish: true - include: - - rust: nightly - - rust: beta - - rust: stable - -# only build pushes to master -# prs are build separately -# https://docs.travis-ci.com/user/pull-requests/#how-pull-requests-are-built -branches: - only: - - master - -install: - - | - if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then - cargo install cargo-tarpaulin -f - rustup component add rustfmt - fi -script: - - | - if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then - cargo fmt --all -- --check - fi - - cargo test - -# Cache `cargo install`ed tools, but don't cache the project's `target` -# directory (which ends up over-caching and filling all disk space!) -# https://levans.fr/rust_travis_cache.html -cache: - directories: - - $HOME/.cargo - - $HOME/.rustup - -before_cache: - # But don't cache the cargo registry - - rm -rf /home/travis/.cargo/registry - # Travis can't cache files that are not readable by "others" - - chmod -R a+r $HOME/.cargo - -addons: - apt: - packages: - # required by tarpaulin code coverage tool - - libssl-dev - -after_success: - # report coverage to coveralls - # see https://github.com/xd009642/tarpaulin for more information - - '[ $TRAVIS_EVENT_TYPE != "cron" ] && - [ $TRAVIS_RUST_VERSION = stable ] && - [ $TRAVIS_BRANCH = master ] && - [ $TRAVIS_PULL_REQUEST = false ] && - cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID || true' - - '[ $TRAVIS_RUST_VERSION = stable ] && - [ $TRAVIS_BRANCH = master ] && - [ $TRAVIS_PULL_REQUEST = false ] - && cargo doc --no-deps && - echo "" > target/doc/index.html' - -deploy: - provider: pages - skip-cleanup: true - github-token: $GH_TOKEN - local-dir: target/doc - keep-history: false - on: - branch: master - condition: $TRAVIS_RUST_VERSION = stable