136 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			136 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: CI
 | |
| on:
 | |
|   pull_request:
 | |
|   push:
 | |
|     branches:
 | |
|       - master
 | |
| 
 | |
| env:
 | |
|   RUST_BACKTRACE: 1
 | |
| 
 | |
| jobs:
 | |
|   ci-pass:
 | |
|     name: CI is green
 | |
|     runs-on: ubuntu-latest
 | |
|     needs:
 | |
|       - style
 | |
|       - test
 | |
|       - features
 | |
|       - doc
 | |
|     steps:
 | |
|       - run: exit 0
 | |
| 
 | |
|   style:
 | |
|     name: Check Style
 | |
|     runs-on: ubuntu-latest
 | |
|     steps:
 | |
|       - name: Checkout
 | |
|         uses: actions/checkout@v1
 | |
| 
 | |
|       - name: Install Rust
 | |
|         uses: actions-rs/toolchain@v1
 | |
|         with:
 | |
|           profile: minimal
 | |
|           toolchain: stable
 | |
|           override: true
 | |
|           components: rustfmt
 | |
| 
 | |
|       - name: cargo fmt --check
 | |
|         uses: actions-rs/cargo@v1
 | |
|         with:
 | |
|           command: fmt
 | |
|           args: --all -- --check
 | |
| 
 | |
|   test:
 | |
|     name: Test ${{ matrix.rust }} on ${{ matrix.os }}
 | |
|     needs: [style]
 | |
|     strategy:
 | |
|       matrix:
 | |
|         rust:
 | |
|           - stable
 | |
|           - beta
 | |
|           - nightly
 | |
|           - 1.45.2
 | |
| 
 | |
|         os:
 | |
|           - ubuntu-latest
 | |
|           - windows-latest
 | |
|           - macOS-latest
 | |
| 
 | |
|         include:
 | |
|           - rust: stable
 | |
|             features: "--features full"
 | |
|           - rust: beta
 | |
|             features: "--features full"
 | |
|           - rust: nightly
 | |
|             features: "--features full,nightly"
 | |
|             benches: true
 | |
| 
 | |
|     runs-on: ${{ matrix.os }}
 | |
| 
 | |
|     steps:
 | |
|       - name: Checkout
 | |
|         uses: actions/checkout@v1
 | |
| 
 | |
|       - name: Install Rust (${{ matrix.rust }})
 | |
|         uses: actions-rs/toolchain@v1
 | |
|         with:
 | |
|           profile: minimal
 | |
|           toolchain: ${{ matrix.rust }}
 | |
|           override: true
 | |
| 
 | |
|       - name: Test
 | |
|         uses: actions-rs/cargo@v1
 | |
|         with:
 | |
|           command: test
 | |
|           args: ${{ matrix.features }}
 | |
| 
 | |
|       - name: Test all benches
 | |
|         if: matrix.benches
 | |
|         uses: actions-rs/cargo@v1
 | |
|         with:
 | |
|           command: test
 | |
|           args: --benches ${{ matrix.features }}
 | |
| 
 | |
|   features:
 | |
|     name: features
 | |
|     needs: [style]
 | |
|     runs-on: ubuntu-latest
 | |
|     steps:
 | |
|       - name: Checkout
 | |
|         uses: actions/checkout@v1
 | |
| 
 | |
|       - name: Install Rust
 | |
|         uses: actions-rs/toolchain@v1
 | |
|         with:
 | |
|           profile: minimal
 | |
|           toolchain: nightly
 | |
|           override: true
 | |
| 
 | |
|       - name: Install cargo-hack
 | |
|         run: cargo install cargo-hack
 | |
| 
 | |
|       - name: check --each-feature
 | |
|         run: cargo hack check --each-feature -Z avoid-dev-deps
 | |
| 
 | |
|   doc:
 | |
|     name: Build docs
 | |
|     needs: [style, test]
 | |
|     runs-on: ubuntu-latest
 | |
|     steps:
 | |
|       - name: Checkout
 | |
|         uses: actions/checkout@v1
 | |
| 
 | |
|       - name: Install Rust
 | |
|         uses: actions-rs/toolchain@v1
 | |
|         with:
 | |
|           profile: minimal
 | |
|           toolchain: nightly
 | |
|           override: true
 | |
| 
 | |
|       - name: cargo doc
 | |
|         uses: actions-rs/cargo@v1
 | |
|         with:
 | |
|           command: rustdoc
 | |
|           args: --features full -- --cfg docsrs -D broken-intra-doc-links
 |