Sequential jobs without dependency

Rule ID

parallel_opportunity

Category

energy

Severity

low

Multiple jobs run sequentially but have no dependency on each other. Running them in parallel would reduce total pipeline duration and energy use.

Detection

heuristic — Structural comparison across multiple jobs or steps.

Examples

Non-compliant:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - run: npm run lint
  test:
    needs: lint
    steps:
      - run: npm test
  build:
    needs: test
    steps:
      - run: npm run build

Compliant:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - run: npm run lint
  test:
    runs-on: ubuntu-latest
    steps:
      - run: npm test
  build:
    runs-on: ubuntu-latest
    steps:
      - run: npm run build

Fix: Remove unnecessary needs: dependencies between jobs that do not share outputs. GitHub Actions runs independent jobs in parallel by default.