Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci_ctests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Physics Scheme Unit Tests (CTest)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change to something like "Smoke-Dust Unit Tests (CTest)"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure


on: [push, pull_request]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this is triggered using the following:
on:
push:
branches: [main]
pull_request:
workflow_dispatch:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that we want this to run on every push to save GitHub resources.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are very lightweight and wouldn't really be a limiting factor in my opinion. We should do it on PRs so that we know within the PR if it is failing before the PR is approved.


jobs:
ctests:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto more descriptive name here.
If/when more schemes add unit tests, we want to have a name that is extensible

if: github.repository == 'NCAR/ccpp-physics' || github.repository == 'ufs-community/ccpp-physics' || github.repository == 'bbakernoaa/ccpp-physics'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be either "only the authoritative repository" or "any repository".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. These are small enough it could any repository.

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gfortran cmake
Comment on lines +14 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be ok for now, in the long run we need another option so that we have ESMF, w3emc, ip, bacio. We can probably piggyback on the container solution that @dustinswales is working on for running SCM from this repository.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These unit tests don't need ESMF or any other dependencies, just fortran and cmake.

The CCPP SCM tests do need all of those other things, which is a pain to install/maintain on the GitHub runners, not to mention slow. So we are moving to containerized CI to give us total control, plus access to proprietary compilers.


- name: Build and run smoke and dust tests
run: |
cd physics/smoke_dust/tests
mkdir build
cd build
cmake ..
make
ctest --output-on-failure
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make debugging easier when a test fails in the CI, would it be possible to add an upload-artifact step?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we could do that

Loading