on:
  push:
    branches: [master]
  pull_request:
name: coverage
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install browsers
        run: |
          ./ci/ubuntu-latest-firefox
          ./ci/ubuntu-latest-chrome
      - name: Install cargo-tarpaulin
        uses: actions-rs/install@v0.1
        with:
          crate: cargo-tarpaulin
          version: latest
          use-tool-cache: true
      - name: Generate code coverage
        run: |
          cargo tarpaulin --verbose --timeout 120 --out Xml
      - name: Upload to codecov.io
        uses: codecov/codecov-action@v2
        with:
          fail_ci_if_error: true
