File: step_coverage.yaml

package info (click to toggle)
spglib 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,180 kB
  • sloc: ansic: 125,066; python: 7,717; cpp: 2,197; f90: 2,143; ruby: 792; makefile: 22; sh: 18
file content (64 lines) | stat: -rw-r--r-- 1,792 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
name: 👀 coverage

on:
  workflow_call:
    secrets:
      CODECOV_TOKEN:
        description: Codecov token of the main repository
        required: false


permissions:
  contents: read

jobs:
  ctest:
    name: ${{ matrix.coverage }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        coverage: [ unit_tests, c_api, fortran_api ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: lukka/get-cmake@latest
      - name: Get test coverage for ${{ matrix.coverage }}
        uses: lukka/run-cmake@v10
        with:
          workflowPreset: "ci-coverage-${{ matrix.coverage }}"
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          name: ${{ matrix.coverage }} coverage
          flags: ${{ matrix.coverage }}
          verbose: true

  pytest:
    name: python_api
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v6
        with:
          python-version: 3.x
      - name: Setup spglib
        run: |
          python -m pip install --upgrade pip
          pip install -e .[test-cov] \
            --config-settings=cmake.define.CMAKE_C_COMPILER=gcc \
            --config-settings=cmake.define.SPGLIB_WITH_TESTS=ON \
            --config-settings=cmake.define.SPGLIB_TEST_COVERAGE=ON \
            --config-settings=build-dir=build
      - name: Test pytest with coverage
        run: pytest --cov=spglib
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          name: python_api coverage
          flags: python_api
          verbose: true