Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize GitHub CI to Skip Unnecessary Tests Based on File Changes #14585

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from

Conversation

lukaszcl
Copy link
Collaborator

@lukaszcl lukaszcl commented Sep 27, 2024

This PR optimizes the GitHub CI workflows by implementing the following changes:

  1. Skip E2E tests on Markdown changes: E2E tests will not run when only Markdown files are modified.
  2. Isolate unit and E2E tests:
    • Unit tests will not run when only end-to-end test files are changed.
    • E2E tests will not run when only unit test files are changed.

Tests conducted for this PR:

@lukaszcl lukaszcl requested review from a team as code owners September 27, 2024 08:16
@lukaszcl lukaszcl marked this pull request as draft September 27, 2024 08:16
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from aa8c94a to a1b6d85 Compare September 27, 2024 08:35
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from 22aac96 to 8bd9f8e Compare September 27, 2024 09:15
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch 4 times, most recently from fd6ab24 to feb168b Compare September 27, 2024 09:53
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from feb168b to b414fc5 Compare September 27, 2024 09:55
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from 10dadb0 to ba81089 Compare September 27, 2024 09:58
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from 2676d33 to 226d143 Compare September 27, 2024 10:15
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from 4b00468 to 086d88c Compare September 27, 2024 12:01
@lukaszcl lukaszcl force-pushed the TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes branch from 40ba1f4 to 2b74e11 Compare September 27, 2024 12:24
@lukaszcl lukaszcl changed the title Do not run tests on markdown changes Optimize GitHub CI to Skip Unnecessary Tests Based on File Changes Sep 27, 2024
Copy link
Contributor

github-actions bot commented Oct 14, 2024

WF: CI Core#1267d73

No errors found in this run. 🎉

@lukaszcl lukaszcl marked this pull request as ready for review October 14, 2024 12:14
Copy link
Contributor

@scheibinger scheibinger left a comment

Choose a reason for hiding this comment

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

Nice improvement, could you rename inputs and output params to use dashes instead of underscores, like in the most of the reusable actions in CL?

.github/actions/filter-changes/action.yml Outdated Show resolved Hide resolved
scheibinger
scheibinger previously approved these changes Oct 15, 2024
.github/workflows/ci-core.yml Outdated Show resolved Hide resolved
…s-are-changes' and 'TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes' of https://github.com/smartcontractkit/chainlink into TT-1629-Optimise-Github-CI-checks-when-readme-md-files-are-changes
@lukaszcl lukaszcl requested a review from jmank88 October 15, 2024 14:56
@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Comment on lines +424 to +425
needs: [filter]
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') && github.actor != 'dependabot[bot]' && needs.filter.outputs.not_ignored_changes == 'true' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This applies to all modules. It must not be skipped for integration-tests/ changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be fixed in 29eba8e0bcf625b17870e36793b80925416b9aeb

lint-scripts:
# We don't directly merge dependabot PRs, so let's not waste the resources
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }}
needs: changes
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' && needs.changes.outputs.not_ignored_changes == 'true' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look right to me. We expect scheduled runs to execute regardless of changes.

golangci:
# We don't directly merge dependabot PRs, so let's not waste the resources
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }}
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' && needs.filter.outputs.not_ignored_changes == 'true' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Scheduled runs are against the state of the repo, and whether or not there are recent changes is not relevant. We expect to flag all outstanding linter debt.

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.

3 participants