devops-reference
devops-reference copied to clipboard
examples/gihub-actions: GitHub Actions running 5 jobs in parallel (each tests every 5th file)
We need to create a document/guide that explains how to improve runtime of jobs that run expensive tasks using parallel executions. One example is the following:
ci.yml
name: CI
on: push
jobs:
tslint:
runs-on: ubuntu-latest
strategy:
matrix:
job: 0, 1, 2, 3, 4
steps:
- uses: actions/checkoutv3
- run: npm ci
- run: |
find . -name '.ts' -not -name '.d.ts' -not -path './node_modules/*' | sort |
awk "NR % $NUM_JOBS == $JOB" | xargs npm run lint --
env:
NUM_JOBS: 5
JOB: ${{ matrix.job }}
package.json
{ "scripts": { "lint": "eslint . . ." } }
┆Issue is synchronized with this Clickup task by Unito