diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..5f26128 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,53 @@ +name: Test + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - nightly + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - name: Build + run: cargo build + - name: Test + run: cargo test + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt clippy + - name: Run rustfmt check + run: cargo fmt --all -- --check + - name: Run clippy + run: cargo clippy --all --all-targets -- -D warnings + + all-features: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly # The bench feature requires nightly + - name: Test all features + run: cargo test --all-features + + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 740f724..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: rust -rust: - - stable - - 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 test - - | - [ $TRAVIS_RUST_VERSION != nightly ] || - cargo test --all-features