Skip to content

Tr/fix codecov#1531

Open
imreddyTeja wants to merge 6 commits intomainfrom
tr/fix-codecov
Open

Tr/fix codecov#1531
imreddyTeja wants to merge 6 commits intomainfrom
tr/fix-codecov

Conversation

@imreddyTeja
Copy link
Copy Markdown
Member

@imreddyTeja imreddyTeja commented Nov 5, 2025

Purpose

Codecov was not being submitted because the token was missing for the repo. This is now fixed (this pr does not need to merged for that). Instead of submitting a codecov report for each os/Julia combo, only one of which is used, this only submits a codecov for a single version. Coverage is also disabled for the other tests, which should make them run slightly faster.


  • I have read and checked the items on the review checklist.

@imreddyTeja imreddyTeja force-pushed the tr/fix-codecov branch 2 times, most recently from 8d0d9c5 to fddf791 Compare November 5, 2025 01:43
@imreddyTeja imreddyTeja marked this pull request as ready for review November 5, 2025 21:09
@juliasloan25
Copy link
Copy Markdown
Member

I'm ok with running the CI jobs on main as well. I wonder if we could structure it so we only run the julia 1.10 x ubuntu combination on main.

As far as the GHA cache I don't fully understand which branches can access it. @petebachant maybe you understand more?

@petebachant
Copy link
Copy Markdown
Member

I'm ok with running the CI jobs on main as well. I wonder if we could structure it so we only run the julia 1.10 x ubuntu combination on main.

As far as the GHA cache I don't fully understand which branches can access it. @petebachant maybe you understand more?

It sounds like Teja is right, that branches don't share caches, but they can fall back to the default branch's cache: https://github.com/actions/cache?tab=readme-ov-file#cache-scopes

So yeah, running on main might increase the number of cache hits for PRs that don't change any Project or Manifest files.

@imreddyTeja
Copy link
Copy Markdown
Member Author

@petebachant @juliasloan25 Has GitHub started enforcing the cache size limit yet? The cache for this repo says "(30.66 GB of 10 GB Used)".

If a single cache for ci is about 2GB, maybe it makes sense to only cache from main, so all branches can use it. We currently create 12 GB of caches per branch.

@petebachant
Copy link
Copy Markdown
Member

I assume they are dropping entries from the cache. It used to be up in the hundreds of GB at one point.

Maybe we're also caching more than we need to:

      - name: Cache Julia depot
        uses: actions/cache@v4
        with:
          # Cache Julia's depot
          path: |
            ~/.julia/packages
            ~/.julia/compiled
            ~/.julia/artifacts
            ~/.julia/scratchspaces
            ~/.julia/registries
            ~/.julia/logs

Sounds like maybe packages, registries, and compiled are the important ones.

@kmdeck
Copy link
Copy Markdown
Member

kmdeck commented Nov 6, 2025

What does it mean to run CI/code cov on main (vs on the branch being merged into main?

Comment thread .github/workflows/ci.yml
- name: Run tests
uses: julia-actions/julia-runtest@v1
with:
coverage: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we also need 1.11?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think the "correct" thing to do is upload a codecov report for every Julia version/os combination. I don't think we have anything in ClimaLand that depends on the Julia version or os, so the reports should all be the same.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's ok to just check coverage on one Julia version/OS pair like this

This should reduce cache clobbering.
@imreddyTeja
Copy link
Copy Markdown
Member Author

What does it mean to run CI/code cov on main (vs on the branch being merged into main?

I think I was incorrect about needing to run codecov on main.

All other workflows changes to not update caches.
Artifacts no longer cached.
@petebachant
Copy link
Copy Markdown
Member

Keep in mind that a cache hit appears to only save ~1 minute on the CI job, so spending a ton of time on optimizing might not be worth the trouble.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +50 to +55
- if: ${{ matrix.version != '1.10' || matrix.os != 'ubuntu-latest' }}
uses: julia-actions/julia-runtest@v1
with:
coverage: false
- if: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }}
uses: julia-actions/julia-runtest@v1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- if: ${{ matrix.version != '1.10' || matrix.os != 'ubuntu-latest' }}
uses: julia-actions/julia-runtest@v1
with:
coverage: false
- if: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }}
uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-runtest@v1
with:
coverage: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }}

${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }} will be a boolean that's true when we run with Julia 1.10 and ubuntu only, so I think this should work

Comment thread .github/workflows/ci.yml
with:
file: lcov.info
token: ${{secrets.CODECOV_TOKEN}}
files: lcov.info
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should this be files or file? do we need to change the line above too?

Comment thread .github/workflows/ci.yml
- name: Run tests
uses: julia-actions/julia-runtest@v1
with:
coverage: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's ok to just check coverage on one Julia version/OS pair like this

name: update_caches
on:
schedule:
- cron: "0 0 * * *"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be good for this to run overnight. I would assume this uses UTC, and 12am UTC = 4am PST. So we could change to 0 8 * * * to run at our midnight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants