diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ddf1daf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +--- +name: Build and test +on: + - push + # Build if requested manually from the Actions tab + - workflow_dispatch + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: --deny warnings + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt + default: true + - name: Check formatting + run: cargo fmt -- --check + +# Enable this after fixing all the stuff clippy complains about +# linting: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: stable +# components: clippy +# default: true +# - name: Lint (clippy) +# uses: actions-rs/clippy-check@v1 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} + + build-and-test: + strategy: + matrix: + rust: [stable, beta, nightly, 1.60.0] + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + default: true + + - name: Build + run: cargo build --all-targets + + - name: Test + run: cargo test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a4e43bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: rust -cache: cargo -rust: - - nightly - - stable - - beta - - 1.42.0 -os: - - osx - - -before_script: - - export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH - - env - -script: - - cargo build --verbose - - sudo cargo test --verbose -- --test-threads=1 - - sudo chmod -R o+w target/ - - if [ "${TRAVIS_RUST_VERSION}" = "stable" ]; then - rustup component add rustfmt; - rustfmt --version; - cargo fmt -- --check; - else - echo "Not checking formatting on this build"; - fi - -notifications: - email: - on_success: never - on_failure: never