Experiment with a files-changed.json per PR (#161788)

This is an experiment to determine what the wall time of a (minimal)
"upload a JSON file describing files changed".

We are looking for this to take (low) single digit minutes, because if
we use this file (and expand it to become a build plan), it will block
almost _all_ other actions, and will likely get longer as we add more
complex logic and checks. Here's hoping!
This commit is contained in:
Matan Lurey
2025-01-22 12:22:30 -08:00
committed by GitHub
parent 2d3beadffe
commit cc9c13e009
4 changed files with 118 additions and 9 deletions

37
.github/workflows/files-changed.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Generate Changed Files JSON
on:
pull_request:
types:
- opened
- synchronize
jobs:
generate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch base commit and origin/master
# Fetch what to compare the commit against
run: |
git fetch --no-tags --prune --depth=1 origin ${{ github.event.pull_request.base.sha }}
git fetch --no-tags --prune --depth=1 origin master
echo "FLUTTER_ENGINE_VERSION=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_ENV"
- name: Initialize Dart SDK
# This downloads the version of the Dart SDK for the current platform.
run: |
./bin/dart --version
cd dev/tools && ../../bin/dart pub get
- name: Write changed files to a JSON file
run: |
./bin/dart run dev/tools/bin/get_files_changed.dart --since="${{ github.event.pull_request.base.sha }}" > changed_files.json
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: changed-files
path: changed_files.json