crystal-lang / install-crystal

GitHub Action: Install Crystal programming language
https://crystal-lang.github.io/install-crystal/configurator.html
MIT License
68 stars 8 forks source link
crystal github-actions shards

install-crystal

GitHub Action to install Crystal programming language and Shards package manager.

Works on Ubuntu, macOS, Windows.

Quickstart

Configurator: get a pre-made config for your exact use case!

Examples

steps:
  - uses: crystal-lang/install-crystal@v1
  - run: crystal eval "puts 1337"
steps:
  - uses: actions/checkout@v4
  - uses: crystal-lang/install-crystal@v1
    with:
      crystal: 1.11
  - run: shards install
  - run: crystal spec
    strategy:
      fail-fast: false
      matrix:
        include:
          - {os: ubuntu-latest, crystal: latest}
          - {os: ubuntu-latest, crystal: nightly}
          - {os: macos-latest}
          - {os: windows-latest}
    runs-on: ${{matrix.os}}
    steps:
      - uses: crystal-lang/install-crystal@v1
        with:
          crystal: ${{matrix.crystal}}
      - uses: actions/checkout@v4
      - run: shards install
      - run: crystal spec
      - run: crystal tool format && git diff --exit-code
        if: matrix.crystal == 'latest'

Find usages in the wild!

Alternatively, you can use the container-based approach as in the starter workflow (without this action), but the advantage here is the unified approach to installation across 3 systems. Using a custom container has disadvantages on its own, too.

Usage

Inputs

Outputs