File: generate_coverage.yml

package info (click to toggle)
rust-taskwarrior-tui 0.26.7-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 732 kB
  • sloc: sh: 75; makefile: 9
file content (68 lines) | stat: -rw-r--r-- 2,108 bytes parent folder | download
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
56
57
58
59
60
61
62
63
64
65
66
67
68
name: generate_coverage

on:
  workflow_call

jobs:
  grcov:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install Taskwarrior
        uses: ./.github/actions/install-taskwarrior
        with:
          secret_gh_token: ${{ secrets.GITHUB_TOKEN }}
      - run: |
          # prepare taskwarrior, initial setup
          task rc.confirmation=off || echo 0

      - name: Install Rust toolchain for grcov compilation
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          override: true
      - name: Install grcov
        uses: clechasseur/rs-cargo@v4
        with:
          command: install
          args: grcov

      - name: Install Rust toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: nightly
          override: true
          components: llvm-tools-preview
      - name: Checkout testdata
        uses: actions/checkout@v6
        with:
          repository: kdheepak/taskwarrior-testdata
          path: taskwarrior-testdata    
      - name: Build taskwarrior-tui with coverage
        uses: clechasseur/rs-cargo@v4
        with:
          command: build
        env:
          RUSTFLAGS: "-Cinstrument-coverage"  
      - name: Run taskwarrior-tui tests in coverage environment
        uses: clechasseur/rs-cargo@v4
        with:
          command: test
          args: --workspace -- --nocapture
        env:
          TASKRC: taskwarrior-testdata/.taskrc
          TASKDATA: taskwarrior-testdata/.task
          RUST_BACKTRACE: full
          RUSTFLAGS: "-Cinstrument-coverage"
          LLVM_PROFILE_FILE: "your_name-%p-%m.profraw"

      - name: Gather coverage data
        run: |
          mkdir ./target/debug/coverage/
          grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/
        shell: bash
      - name: Coveralls upload
        uses: coverallsapp/github-action@v2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          file: ./target/debug/coverage/lcov