Add CI and declare earliest supported version

This commit is contained in:
Ethan Henderson 2022-07-30 16:21:28 +01:00
parent a65a273e8d
commit 909618a78b
3 changed files with 58 additions and 22 deletions

56
.github/workflows/ci.yml vendored Normal file
View file

@ -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

View file

@ -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

View file

@ -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: