forked from firka/flutter
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:
37
.github/workflows/files-changed.yml
vendored
Normal file
37
.github/workflows/files-changed.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user