diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9ab88df --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,58 @@ +name: CI +on: + push: + pull_request: + branches: + - master + +jobs: + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [MSRV, stable, nightly, macos, win32, win64] + include: + - build: MSRV # Minimum supported Rust version + os: ubuntu-latest + rust: 1.62.1 + - build: stable + os: ubuntu-latest + rust: stable + - build: nightly + os: ubuntu-latest + rust: nightly + - build: macos + os: macos-latest + rust: stable + - build: win32 + os: windows-latest + rust: stable-i686-msvc + - build: win64 + os: windows-latest + rust: stable-x86_64-msvc + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + steps: + - uses: actions/checkout@master + - name: Cache CARGO_HOME + uses: actions/cache@v1 + with: + path: ~/.cargo + key: ${{ runner.os }}-cargo-home-${{ hashFiles('**/Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo-home + - name: Install Rust + shell: bash + run: | + curl -sSL https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain=none + export PATH="$HOME/.cargo/bin:$PATH" + rustup override set ${{ matrix.rust }} + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: rustfmt + shell: bash + if: runner.os == 'Linux' && matrix.rust == 'stable' + run: | + rustup component add rustfmt + cargo fmt -- --check + - run: cargo build + - run: cargo test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e4e48da..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly -matrix: - allow_failures: - - rust: nightly - -script: - - cargo build --verbose --features=derive - - RUST_BACKTRACE=1 cargo test --all --verbose --features=derive diff --git a/README.md b/README.md index 717fe6a..449b01b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,13 @@ - [![Build Status](https://travis-ci.org/m4b/scroll.svg?branch=master)](https://travis-ci.org/m4b/scroll) +[![Actions][actions-badge]][actions-url] +[![crates.io version][crates-scroll-badge]][crates-scroll] + + + +[actions-badge]: https://github.com/m4b/scroll/workflows/CI/badge.svg?branch=master +[actions-url]: https://github.com/m4b/scroll/actions +[crates-scroll-badge]: https://img.shields.io/crates/v/scroll.svg +[crates-scroll]: https://crates.io/crates/scroll + ## Scroll - cast some magic ```text