Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Github Actions CI #225

Merged
merged 1 commit into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI - stable tests

on: [push, pull_request]

jobs:
tests:
name: Run tests (Rust stable on ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false # if one job failed, don't stop everything
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest

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

- name: Install Rust toolchain
id: install-rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Extract cache
uses: actions/cache@v2
with:
path: |
~/.cargo
!~/.cargo/registry/index
!~/.cargo/git/checkouts
target
!target/tests
!target/examples
# Every OS/compiler pair has its own cache
key: ${{ runner.os }}-${{ steps.install-rust.outputs.rustc_hash }}

- name: Test use_serde and try-from
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose --features "use_serde try-from"

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

- name: Test a few more features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features "autoconvert f32 si use_serde try-from"

- name: Build some tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-run --no-default-features --features "autoconvert usize isize bigint bigrational si std use_serde try-from"

- name: Build some more tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 bigint biguint rational rational32 rational64 bigrational f32 f64 std use_serde try-from"
40 changes: 40 additions & 0 deletions .github/workflows/non-stable-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI - non-stable tests

on: [push, pull_request]

jobs:
tests:
name: Run tests (Rust ${{ matrix.rust }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
continue-on-error: true

strategy:
fail-fast: false # if one job failed, don't stop everything
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
rust:
- beta
- nightly
- 1.37.0 # MSRV

# there's no point in caching these runs: CI time is less than 5 min
steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Test use_serde and try-from
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose --features "use_serde try-from"
32 changes: 32 additions & 0 deletions .github/workflows/rustfmt-clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Rustfmt & Clippy

on: [pull_request, push]

jobs:
rustfmt_clippy:
name: Clippy & Rustfmt
runs-on: ubuntu-latest

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

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.48.0
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --tests -- -D warnings
42 changes: 42 additions & 0 deletions .github/workflows/tarpaulin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code Coverage

on: [push]

jobs:
tarpaulin:
name: Tarpaulin
runs-on: ubuntu-latest
continue-on-error: true

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

- name: Install Rust toolchain
id: install-rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.48.0
override: true

- name: Extract cache
uses: actions/cache@v2
with:
path: |
~/.cargo
!~/.cargo/registry/index
!~/.cargo/git/checkouts
target
!target/tests
!target/examples
# Tarpaulin has its own cache, every OS/compiler cache is separate
key: tarpaulin-${{ runner.os }}-${{ steps.install-rust.outputs.rustc_hash }}

- name: Run tarpaulin
uses: actions-rs/[email protected]

- name: Upload to codecov.io
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.