Replies: 1 comment
-
I did manage to speed up the initial checkout, and also the running of the tj-actions/changed-files action - with a Sparse Checkout. By not retrieving most of the large files (many whole-file replacements and vendored libraries) the initial checkout has gone from 21s to 8 seconds, and the 'changed-files' step from 180 secs to just 8 seconds because it already has everything it should need. Here are sample steps that achieve this speedup: on: [pull_request]
name: Main
jobs:
phptools-for-changed-files:
name: CS-Fixer-Tool
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
/.*
!/*/
/.github
'/Makefile'
/src/
!/src/css/
!/src/js/
!/src/other-big-directories/
/tests/
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
# now run a command based on ${{ steps.changed-files.outputs.all_changed_files }} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a large and somewhat busy repository (now over 80,000 commits), that I'm writing a workflow for - getting the files that are newly created or edited in a PR, and then I'll run some coding standards on the appropriate files.
The first two steps are:
The initial checkout for my own PR takes ~23seconds, but the
tj-actions/changed-files@v44
step is taking a little more than 3 minutes for a (fairly recent - couple of days old) pull-request in the repo.Is there a way optimise the fetching of commits, so that it does not take as much time? I've been, for example, trying to find a way to only checkout the main branch where it is about to start the PR's branch, but haven't had much luck yet.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions