name: Code Coverage

on: [push]

jobs:
  check:
    name: codecov nwr
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

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

      - uses: Swatinem/rust-cache@v1

      - name: Run cargo-tarpaulin
        uses: actions-rs/tarpaulin@v0.1
        with:
          version: '0.18.0'
          args: ' --bins --tests --follow-exec -- --test-threads 1'

      - name: Upload to codecov.io
        uses: codecov/codecov-action@v2
