---
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This file is part of nvme.
# Copyright (c) 2026 SUSE LLC
#
# Authors: Daniel Wagner <dwagner@suse.de>

name: Codecov

on:
  workflow_dispatch:

jobs:
  code-coverage:
    if: github.repository == 'linux-nvme/nvme-cli'
    name: code coverage
    runs-on: ubuntu-latest
    continue-on-error: true
    container:
      image: ghcr.io/linux-nvme/debian:latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
      - name: Mark repo as safe for git
        run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
      - name: build
        run: |
          scripts/build.sh -p
      - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
        env:
          CODECOV_WORKING_DIR: ${{ github.workspace }}
        with:
          root_dir: ${{ github.workspace }}
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage.xml
          fail_ci_if_error: false
