Conversation
|
View your CI Pipeline Execution ↗ for commit e002eac ☁️ Nx Cloud last updated this comment at |
- we're just using the default coverageReporters: https://jestjs.io/docs/configuration#coveragereporters-arraystring--string-options - the base config is using the preset, so we only need to declare reporters in one place - 'summary' is an invalid reporter - we want to always include the github-actions reporter in CI
these are different from the reporters
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
- nx run-many instead of nx affected to guarantee main tests always reflect the whole repo - differentiate between PRs and main coverage with tags
use latest ubuntu LTS version
from https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request: > By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened.
|
heads up that while trying to get the test analytics working, I discovered that the junit reports weren't ever being generated/uploaded, so I took some time to fix that and refactored the Jest configs a bit. You can verify that the reports weren't being uploading by looking at the test-results artifacts in this PR and others:
This should also theoretically enable GitHub's coverage annotations in PR diffs, but we'll have to wait until merging to verify that. |
aresnik11
left a comment
There was a problem hiding this comment.
Nice! looks good and makes sense to me!
| run: git fetch origin main:main | ||
| if: github.event_name == 'pull_request' | ||
| - name: Ensure workflow is associated with a pull request | ||
| uses: ./.github/actions/validate-pr-context |
There was a problem hiding this comment.
i think the whole validate-pr-context thing is a remnant of circleCI where we couldn't choose triggers other than push, so we had to make sure that the PR was associated before making comments and stuff. I don't think it is relevant/needed with this workflow. Could clean that up later but in the meantime this is a little confusing.
There was a problem hiding this comment.
ah, that explains it! I had a version where I removed these steps but reverted it because it felt too unrelated to the PR.
| - name: Skip build from automated commit | ||
| uses: ./.github/actions/skip-automated-commits | ||
| if: github.event_name == 'pull_request' |
There was a problem hiding this comment.
this also doesn't really matter anymore, it's ok if we run tests after the bot commits changes after publishing.
jakemhiller
left a comment
There was a problem hiding this comment.
lgtm! a couple non-blocking comments
|
🚀 Styleguide deploy preview ready! Preview URL: https://6977d8f962077b3b0e9f5d87--gamut-preview.netlify.app |
This adds Codecov to Gamut, including an initial codecov.yml config, coverage reporting, and their new test analytics so we can try it out.
Note that it only runs for PRs so we can test it. It should result in a report at https://app.codecov.io/gh/Codecademy/gamut/. If it works, I'll add it for the full repo.Here are the Codecov results for this branch:
I also made a few optimizations to the test workflow:
24.04) (fd83cc5)if: ${{ !cancelled() }}overif: always(). (68858a2)pull_request.typesarray since it's just the default triggers (a2cc842)And I refactored the Jest configs a bit in b184152:
./coverage. These reports were previously writing to/tmpin CI, which felt unnecessary, since./coverageis gitignored and anything written to the filesystem during a GitHub Actions run goes away after the runner finishes the job, so there's no real need to write to memory. Correct me if I'm misunderstanding something about how nx caches things, though.jest.preset.jsfile into thejest.config.base.tsexcept the@nx/jest/presetstuff. I initially just got rid of the preset entirely, but it seemed like thepreset: 'path/to/jest-preset.jsis doing something more than just merging objects, so I left it as-is.nx g @nx/jest:configuration --project=gamutto see what the generator created, and it did something similar (packages/gamut/jest.config.tshad apreset:field pointing to the root preset).PR Checklist