Skip to content
Latchkey

Install Script workflow (starship/starship)

The Install Script workflow from starship/starship, explained and optimized by Latchkey.

C

CI health: C - fair

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

Grade your own workflow free or run it on Latchkey →
Source: starship/starship.github/workflows/install-script.ymlLicense ISCView source

What it does

This is the Install Script workflow from the starship/starship repository, a real project running GitHub Actions. It is shown here with attribution under its ISC license.

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

The workflow

workflow (.yml)
name: Install Script
on:
  push:
    paths:
      - "install/**"
  pull_request:
    paths:
      - "install/**"

jobs:
  shellcheck:
    name: Shellcheck [Linter]
    runs-on: ubuntu-latest
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

      - name: Lint | Run shellcheck
        run: shellcheck --severity=warning install/**/*.sh

  shfmt:
    name: Shfmt [Formatter]
    runs-on: ubuntu-latest
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

      - name: Setup | Install shfmt
        run: |
          curl -sS https://webi.sh/shfmt | sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"

      - name: Format | Check shfmt
        run: shfmt -d install/**/*.sh

  test_install_script:
    name: Test Install Script
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

      - name: Test | Piped execution with curl
        run: |
          # Test the installation method described at https://starship.rs/
          mkdir -p "$HOME/.test-install"
          curl -sS "file://$(pwd)/install/install.sh" | sh -s -- --yes --bin-dir "$HOME/.test-install"
          "$HOME/.test-install/starship" --version

The same workflow, on Latchkey

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

name: Install Script
on:
  push:
    paths:
      - "install/**"
  pull_request:
    paths:
      - "install/**"
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  shellcheck:
    timeout-minutes: 30
    name: Shellcheck [Linter]
    runs-on: latchkey-small
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
 
      - name: Lint | Run shellcheck
        run: shellcheck --severity=warning install/**/*.sh
 
  shfmt:
    timeout-minutes: 30
    name: Shfmt [Formatter]
    runs-on: latchkey-small
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
 
      - name: Setup | Install shfmt
        run: |
          curl -sS https://webi.sh/shfmt | sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
 
      - name: Format | Check shfmt
        run: shfmt -d install/**/*.sh
 
  test_install_script:
    timeout-minutes: 30
    name: Test Install Script
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
 
      - name: Test | Piped execution with curl
        run: |
          # Test the installation method described at https://starship.rs/
          mkdir -p "$HOME/.test-install"
          curl -sS "file://$(pwd)/install/install.sh" | sh -s -- --yes --bin-dir "$HOME/.test-install"
          "$HOME/.test-install/starship" --version
 

What changed

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 3 jobs (4 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow