diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..7d0a4a5 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,16 @@ +on: [push, pull_request] + +name: Rustfmt check + +jobs: + fmt: + name: rustfmt + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Run rustfmt check + run: | + rustup component add rustfmt + cargo fmt --version + cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt --version))"; false) diff --git a/.github/workflows/linuxci.yml b/.github/workflows/linuxci.yml new file mode 100644 index 0000000..7455ed2 --- /dev/null +++ b/.github/workflows/linuxci.yml @@ -0,0 +1,36 @@ +on: [push, pull_request] + +name: GNU/Linux CI + +jobs: + check: + name: GNU/Linux CI + runs-on: ubuntu-latest + steps: + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions/checkout@v2 + - name: Install latest stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test diff --git a/.github/workflows/macosci.yml b/.github/workflows/macosci.yml new file mode 100644 index 0000000..e442894 --- /dev/null +++ b/.github/workflows/macosci.yml @@ -0,0 +1,36 @@ +on: [push, pull_request] + +name: macOS CI + +jobs: + check: + name: macOS CI + runs-on: macos-latest + steps: + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions/checkout@v2 + - name: Install latest stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test diff --git a/.github/workflows/windowsci.yml b/.github/workflows/windowsci.yml new file mode 100644 index 0000000..99f1490 --- /dev/null +++ b/.github/workflows/windowsci.yml @@ -0,0 +1,20 @@ +on: [push, pull_request] + +name: Windows CI + +jobs: + check: + name: Windows CI + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Install latest stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f313f08..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly - -script: - - | - if [[ $TRAVIS_RUST_VERSION == *stable* ]] - then - rustup component add rustfmt - cargo fmt --version - cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt --version))"; false) - fi - - cargo build --verbose --all - - cargo test --verbose --all