E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
Other
21 stars 16 forks source link

Add github/workflows dir and codecov.yaml file #533

Open rljacob opened 1 year ago

rljacob commented 1 year ago

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

rljacob commented 1 year ago

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."

dqwu commented 1 year ago

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

dqwu commented 1 year ago

@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.

rljacob commented 1 year ago

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