Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci: run tests intelligently based on changes between consecutive commits#9017

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 4 commits intomainfrommatifali/optimize-ci
Aug 11, 2023

Conversation

matifali
Copy link
Member

@matifalimatifali commentedAug 10, 2023
edited
Loading

We are usingdorny/path-filter GitHub action to see which files are changed in our CI.
There is a scenario where it is not optimized.

Current behavior

  1. I change a go file in the first commit, and the path filter detects these changes and runs all go tests.
  2. In 2nd commit, I change some docs and push, the paths filter compares the current PR branch with themain and again detects that a go file and some docs are changed so it runs all go tests

Solution:

run on pushing to any branch.

on:push

This will allow using abase property to set the base as the current branch:github.ref and will detect changes between consecutive commits

This seems to work and is skipping other tests when only the .md file is changed
https://github.com/coder/coder/actions/workflows/ci.yaml?query=branch%3Amatifali%2Foptimize-ci

New Behavior

  1. I update a go file, changes is detected and and ci runs go tests.
  2. I update docs, ci detects that only docs are changed so go tests are skipped.
  3. I mergemain and it has some go and ts files changes. ci runs all go and ts tests.
  4. I again update only docs, ci skip go and tss tests.

This can save us some ci minutes.

@matifalimatifali changed the titleci: oprimize cici: optimize CIAug 10, 2023
@matifalimatifali marked this pull request as ready for reviewAugust 10, 2023 15:53
Copy link
Member

@ammarioammario left a comment

Choose a reason for hiding this comment

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

Interesting approach. PR title is a bit vague.

@matifalimatifali changed the titleci: optimize CIci: calculate file changes between consecutive commitsAug 11, 2023
@matifalimatifali changed the titleci: calculate file changes between consecutive commitsci: run tests intelligently based on changes between consecutive commitsAug 11, 2023
@matifalimatifali merged commit4d8152d intomainAug 11, 2023
@matifalimatifali deleted the matifali/optimize-ci branchAugust 11, 2023 10:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 11, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@ammarioammarioammario approved these changes

@deansheatherdeansheatherAwaiting requested review from deansheather

Assignees

@matifalimatifali

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@matifali@ammario@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp