Skip to content

Commit

Permalink
Add GitHub Actions workflow for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelc authored and Geal committed Oct 31, 2020
1 parent 0a6f4d5 commit 90100d9
Showing 1 changed file with 185 additions and 0 deletions.
185 changes: 185 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: CI

on: [push, pull_request]

env:
RUST_MINVERSION: 1.37.0

jobs:
test:
name: Test
runs-on: ubuntu-latest

strategy:
matrix:
rust:
- stable
- beta
- nightly
- 1.44.0

features:
- '--features "regexp"'

include:
- rust: stable
features: ''
- rust: stable
features: '--features "std lexical regexp"'
- rust: stable
features: '--no-default-features'
- rust: stable
features: '--no-default-features --features "alloc"'
- rust: nightly
features: ''
- rust: nightly
features: '--no-default-features'
- rust: nightly
features: '--no-default-features --features "alloc"'

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose ${{ matrix.features }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose ${{ matrix.features }}

minrust:
name: Test MSRV
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust (${{ env.RUST_MINVERSION }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_MINVERSION }}
profile: minimal
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --no-default-features --features "regexp lexical"

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features "regexp lexical"

bench:
name: Bench
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Compile bench
uses: actions-rs/cargo@v1
with:
command: bench
args: --verbose --no-run --features "regexp"

- name: Run bench
uses: actions-rs/cargo@v1
with:
command: bench
args: --verbose --features "regexp"

doc:
name: Build documentation
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --features "std lexical regexp"

fmt:
name: Check formatting
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true

- name: cargo fmt -- --check
continue-on-error: true
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

coverage:
name: Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin

- name: Run cargo tarpaulin
uses: actions-rs/cargo@v1
with:
command: tarpaulin

0 comments on commit 90100d9

Please sign in to comment.