diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7f86185 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +# "Borrowed" with permission from https://github.com/Jonxslays/piston_rs/blob/master/.github/workflows/ci.yml. +# Thanks bud! + +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + lint-and-format: + name: Lint and format + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Rust (stable) + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Run format check + run: cargo fmt -- --check + + - name: Run clippy check + run: cargo clippy + + test-and-build: + name: Test and build + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + rust_version: [1.31.0, 1.56.0, stable, nightly] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Rust (${{ matrix.rust_version }}) + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust_version }} + + - name: Run tests + run: cargo test + + - name: Build package + run: cargo build diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 1d12c61..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build and test - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose diff --git a/README.md b/README.md index a3bccf5..15cb123 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ An IRC (RFC1459) parser and formatter, built in Rust. +`ircparser` should work on basically any Rust version, but the earliest version checked in the CI is v1.31 (the first version with Rust 2018 support). + ## Setup To use the latest stable version of `ircparser`, add it to your Cargo.toml file like so: