summaryrefslogtreecommitdiff
path: root/.github/workflows/coveralls.yml
blob: b38ec50d7433986c8e694cfeb671ab6b46ae433c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
on:
  push:
    branches-ignore:
      - '**.tmp'

name: coveralls

jobs:
  coveralls:
    runs-on: ubuntu-20.04
    env:
      ZFS_TEMPFS: tpool
    steps:
      - uses: actions/checkout@v1
      - name: Setup Rust Toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          override: true

      - uses: Swatinem/rust-cache@v1

      # note: this works around the gha images sometimes not being up-to-date
      # with ubuntu mirrors, which can result in 404s when fetching packages
      - name: apt-get update
        run: sudo apt-get -o Acquire::Retries=3 update

      - name: Install dependencies
        run: sudo apt install libzfslinux-dev zfsutils-linux

      - name: Setup test pool
        run: sudo ./zfs-core/test-prepare "${ZFS_TEMPFS}"

      - name: Run tests & generate coverage info
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features --no-fail-fast
        env:
          CARGO_INCREMENTAL: '0'
          RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
          RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
      - run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
      - run: zip -0 ccov.zip `find . \( -name "*.gc*" \) -print`
      - run: ./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info
      - name: Archive code coverage results
        uses: actions/upload-artifact@v1
        with:
          name: code-coverage-report
          path: lcov.info
      - name: Upload to coveralls
        uses: coverallsapp/github-action@v1.1.2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: lcov.info