scorpio icon indicating copy to clipboard operation
scorpio copied to clipboard

Add github/workflows dir and codecov.yaml file

Open rljacob opened this issue 2 years ago • 4 comments

Following directions on codecov site to add it as a github action.

rljacob avatar Aug 02 '23 16:08 rljacob

What the directions say: "After you committed your changes [this PR] and ran the repo's CI/CD pipeline. In your pull request, you should see two status checks and PR comment. Once merged to the default branch, subsequent pull requests will have checks and report comment. Additionally, you'll find your repo coverage dashboard here."

rljacob avatar Aug 02 '23 16:08 rljacob

@rljacob @jayeshkrishna It seems that most tutorials use *.yml instead of *.yaml for a workflow file.

dqwu avatar Aug 03 '23 16:08 dqwu

@rljacob @jayeshkrishna This tutorial uses a simple C example: https://about.codecov.io/blog/how-to-set-up-codecov-with-c-and-github-actions

Its workflow file (ci.yml) is

name: Workflow for Codecov example-c
on: [push, pull_request]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Compile calculator
        run: gcc -fprofile-arcs -ftest-coverage -O0 -o test_calculator test_calculator.c calculator.c
      - name: Run tests
        run: ./test_calculator
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v3
        with:
          gcov: true
          gcov_include: calculator.c

For SCORPIO, we also need the checkout/build/run steps to generate GCOV files. Also, SCORPIO uses CMake and it has a lot of dependent libs (netcdf/pnetcdf/...). The workflow file might be complicate like this one: https://github.com/pybind/pybind11/blob/master/.github/workflows/ci.yml

When configuring SCORPIO, we need turn on PIO_ENABLE_COVERAGE CMake option to add GCOV -fprofile-arcs -ftest-coverage flags.

dqwu avatar Aug 03 '23 16:08 dqwu

Ok I guess its not as simple as they suggested. https://app.codecov.io/gh/E3SM-Project/scorpio/new

rljacob avatar Aug 14 '23 15:08 rljacob