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

ci: only run jobs when relevant files have been changed #12006

Merged
merged 25 commits into from
Oct 18, 2023

Commits on Oct 14, 2023

  1. ci: only run jobs when relevant files have been changed

    - e.g. don't run E2E tests if only UI or only Docs have changed
      - or don't run UI CI when UI has not chaged
    
    - use [`tj-actions/changed-files`](https://github.com/tj-actions/changed-files) action for this
      - the most popular and full featured one I could find
    
    - run `changed-files` in its own job that must run before all other jobs
      - have it `output` booleans for specific changes -- limit all the `changed_files` nuances, naming, syntax, etc to that one job
        - job `outputs` are also needed for skipping other jobs, as step outputs can't be directly accessed
          - see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs and https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
    - have other jobs specify it in their `needs` and then skip if not needed with `if`
    
    - use multi-output variant of `changed-files` YAML directive
      - so can check e2e vs docs vs UI etc
    - use `any_modified` as that includes added, copied, modified, renamed, and deleted (ACMRD)
      - `any_changed` does not include deletions
    
    NOTE: I realized after that `docs` isn't a job, `lint` is, so there's gonna be some follow-up commits
    - and well need to test anyway too
    - will also include the `all` list _after_ testing, since it would make everything run
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    9a4ac6c View commit details
    Browse the repository at this point in the history
  2. try checking == 'true'?

    - also tiny renames
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    aafd917 View commit details
    Browse the repository at this point in the history
  3. add workaround for status checks

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    2b36c20 View commit details
    Browse the repository at this point in the history
  4. skip unit tests as well

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    21682cf View commit details
    Browse the repository at this point in the history
  5. add some more relevant files to the lists

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    9dce4cb View commit details
    Browse the repository at this point in the history
  6. full lint checks

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    d278e8b View commit details
    Browse the repository at this point in the history
  7. add empty line in UI to test that UI check runs

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    dbe0b79 View commit details
    Browse the repository at this point in the history
  8. fix to use files_yaml?

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    b17c223 View commit details
    Browse the repository at this point in the history
  9. yaml nots need quoting?

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    4536f54 View commit details
    Browse the repository at this point in the history
  10. dry up config a bit

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    c6de853 View commit details
    Browse the repository at this point in the history
  11. add empty line to test lint

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    3086e78 View commit details
    Browse the repository at this point in the history
  12. try removing the nots?

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    7ebd7d7 View commit details
    Browse the repository at this point in the history
  13. change the DRY mechanism?

    - list merging is not supported in YAML natively, but `changed-files` appears to support it? https://github.com/tj-actions/changed-files/blob/2a10bef1b42044172f2e64d40beeb8fbad792438/test/changed-files.yml#L8-L11
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    188b6d4 View commit details
    Browse the repository at this point in the history
  14. fix needs for lint and codegen

    - both can run independently of each other and independently of tests
      - they should fail fast if the other one fails though, I suppose
    
    - otherwise this breaks some of the checks, since if tests are skipped, then codegen and lint are skipped too
      - or, well, that's my hypothesis at least -- will test by pushing this
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    9aa097e View commit details
    Browse the repository at this point in the history
  15. revert ui test change

    - so now only lint should run...
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    6b506ea View commit details
    Browse the repository at this point in the history
  16. revert lint test change

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    3c7d127 View commit details
    Browse the repository at this point in the history
  17. add empty line to test Codegen

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    34671d7 View commit details
    Browse the repository at this point in the history
  18. revert codegen test change

    This reverts commit 34671d7.
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    c50d621 View commit details
    Browse the repository at this point in the history
  19. add empty line to test E2E

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    98e80c1 View commit details
    Browse the repository at this point in the history
  20. revert E2E test change

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    e183ca9 View commit details
    Browse the repository at this point in the history
  21. add empty line to test units, e2e, lint

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    22b9216 View commit details
    Browse the repository at this point in the history
  22. revert unit test et al change

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    3940d44 View commit details
    Browse the repository at this point in the history
  23. run all jobs when ci-build.yaml is changed

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    a51064c View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. add Makefile + tasks.yaml as well

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    13e0c02 View commit details
    Browse the repository at this point in the history
  2. fix typo in list

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    01aa788 View commit details
    Browse the repository at this point in the history