Skip to content
Latchkey

Coverage workflow (ramda/ramda)

The Coverage workflow from ramda/ramda, explained and optimized by Latchkey.

B

CI health: B - good

Point runs-on at Latchkey and get job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: ramda/ramda.github/workflows/coverage.ymlLicense MITView source

What it does

This is the Coverage workflow from the ramda/ramda repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Coverage

on:
  pull_request_target:
    types: [edited, opened, synchronize, ready_for_review, review_requested, reopened]

jobs:
  coverage:
    if: github.repository == 'ramda/ramda'
    runs-on: ubuntu-latest
    name: Coverage

    permissions:
      issues: write
      contents: read
      pull-requests: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Clean Install
        run: npm ci

      - name: Coverage Summary
        id: coverage-summary
        run: |
          {
            echo 'COVERAGE_SUMMARY_OUTPUT<<EOF'
            npm run coverage:summary
            echo EOF
          } >> "$GITHUB_OUTPUT"

      - name: Coverage Details
        id: coverage-details
        run: |
          {
            echo 'COVERAGE_DETAILS_OUTPUT<<EOF'
            npm run coverage:details
            echo EOF
          } >> "$GITHUB_OUTPUT"

      - name: Log Coverage
        env:
          COVERAGE_SUMMARY_OUTPUT: ${{ steps.coverage-summary.outputs.COVERAGE_SUMMARY_OUTPUT }}
          COVERAGE_DETAILS_OUTPUT: ${{ steps.coverage-details.outputs.COVERAGE_DETAILS_OUTPUT }}
        run: |
          echo "$COVERAGE_SUMMARY_OUTPUT"
          echo "$COVERAGE_DETAILS_OUTPUT"

      - name: Find Comment
        uses: peter-evans/find-comment@v3
        id: find-comment
        continue-on-error: true
        with:
          issue-number: ${{ github.event.pull_request.number }}
          comment-author: 'github-actions[bot]'
          body-includes: Coverage Summary

      - name: Create or update comment
        uses: peter-evans/create-or-update-comment@v4
        with:
          comment-id: ${{ steps.find-comment.outputs.comment-id }}
          issue-number: ${{ github.event.pull_request.number }}
          body: |
            <details>
              <summary>Coverage Summary</summary>

              ```bash
              ${{ steps.coverage-summary.outputs.COVERAGE_SUMMARY_OUTPUT }}
              ```

            </details>
          edit-mode: replace

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Coverage
 
on:
  pull_request_target:
    types: [edited, opened, synchronize, ready_for_review, review_requested, reopened]
 
jobs:
  coverage:
    timeout-minutes: 30
    if: github.repository == 'ramda/ramda'
    runs-on: latchkey-small
    name: Coverage
 
    permissions:
      issues: write
      contents: read
      pull-requests: write
 
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
 
      - name: Clean Install
        run: npm ci
 
      - name: Coverage Summary
        id: coverage-summary
        run: |
          {
            echo 'COVERAGE_SUMMARY_OUTPUT<<EOF'
            npm run coverage:summary
            echo EOF
          } >> "$GITHUB_OUTPUT"
 
      - name: Coverage Details
        id: coverage-details
        run: |
          {
            echo 'COVERAGE_DETAILS_OUTPUT<<EOF'
            npm run coverage:details
            echo EOF
          } >> "$GITHUB_OUTPUT"
 
      - name: Log Coverage
        env:
          COVERAGE_SUMMARY_OUTPUT: ${{ steps.coverage-summary.outputs.COVERAGE_SUMMARY_OUTPUT }}
          COVERAGE_DETAILS_OUTPUT: ${{ steps.coverage-details.outputs.COVERAGE_DETAILS_OUTPUT }}
        run: |
          echo "$COVERAGE_SUMMARY_OUTPUT"
          echo "$COVERAGE_DETAILS_OUTPUT"
 
      - name: Find Comment
        uses: peter-evans/find-comment@v3
        id: find-comment
        continue-on-error: true
        with:
          issue-number: ${{ github.event.pull_request.number }}
          comment-author: 'github-actions[bot]'
          body-includes: Coverage Summary
 
      - name: Create or update comment
        uses: peter-evans/create-or-update-comment@v4
        with:
          comment-id: ${{ steps.find-comment.outputs.comment-id }}
          issue-number: ${{ github.event.pull_request.number }}
          body: |
            <details>
              <summary>Coverage Summary</summary>
 
              ```bash
              ${{ steps.coverage-summary.outputs.COVERAGE_SUMMARY_OUTPUT }}
              ```
 
            </details>
          edit-mode: replace
 
 

What changed

2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow