[CI] Refactor changed files integration (#9643)
# BEFORE [run](https://github.com/twentyhq/twenty/actions/runs/12806801953)  # AFTER [run](https://github.com/twentyhq/twenty/actions/runs/12807034402)  ## Motivations: - less workflow to whitelist as blocking for PRs - less if condition per step cons: - quite verbose - need to manually sync the `ci-NAME-status-check` needs list to any other existing and should be dep jobs ## Version migration Migrated to the latest `changed-files@45` version, getting rid of the `set-output` usage warnings ## Tests runs: With mutation: - [Success flow](https://github.com/twentyhq/twenty/actions/runs/12791958651/job/35661546343) - [server-setup failure flow](https://github.com/twentyhq/twenty/actions/runs/12792225779) - [Other job failure flow](https://github.com/twentyhq/twenty/actions/runs/12792313463), one of the `inner` job failed - [Manual cancel flow](https://github.com/twentyhq/twenty/actions/runs/12792313463) `ci-server-status-check` also has the `cancelled` status - [Matrix failure](https://github.com/twentyhq/twenty/actions/runs/12806883553) Without mutation: - [Nothing to do flow](https://github.com/twentyhq/twenty/actions/runs/12792098384), skipped `inner` job but `ci-server-status-check` still succeeded ## Notes ### Linter We should setup a `yml` prettier and linter for the `.github/worfklows` folder ### Centralized `ci-NAME-status-check` logic Unfortunately I couldn't achieve to either make a `composite` action or a `reusable-workflow`, as I could not access the correct layer to run the `always` but also acessing the `needs` context
This commit is contained in:
27
.github/workflows/changed-files.yaml
vendored
Normal file
27
.github/workflows/changed-files.yaml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: Changed files reusable workflow
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
files:
|
||||
required: true
|
||||
type: string
|
||||
outputs:
|
||||
any_changed:
|
||||
value: ${{ jobs.changed-files.outputs.any_changed }}
|
||||
|
||||
jobs:
|
||||
changed-files:
|
||||
timeout-minutes: 5
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
any_changed: ${{ steps.changed-files.outputs.any_changed }}
|
||||
steps:
|
||||
- name: Fetch custom Github Actions and base branch history
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Check for changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: ${{ inputs.files }}
|
||||
Reference in New Issue
Block a user