Last active
May 23, 2022 04:36
-
-
Save mhart/2fe6606ef2dcd2594c09d74761b192b4 to your computer and use it in GitHub Desktop.
GitHub Actions running 5 tslint jobs in parallel (each tests every 5th file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
tslint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
job: [0, 1, 2, 3, 4] | |
steps: | |
- uses: actions/checkout@v1 | |
- run: | | |
npm ci | |
find . -name '*.ts' -not -name '*.d.ts' -not -path './node_modules/*' | sort | \ | |
awk "NR % $NUM_JOBS == $JOB" | xargs npm run tslint -- | |
env: | |
NUM_JOBS: 5 | |
JOB: ${{ matrix.job }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"tslint": "tslint -p tsconfig.json -t codeFrame" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could also do:
to limit each tslint run to 100 files, and if you've got parallel CPU spare, and then you could do:
which will run 4 tslint processes in parallel with 100 files each
(that is, 4 processes in parallel on each of the 5 CI jobs – for a total of 20 tslint processes in parallel)