setup Crystal action for GitHub Actions.
setup-crystal-action
must execute on Linux or macOS, because I do not know usage that WSL on GitHub Actions.
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
example:
runs-on: ubuntu-20.04
steps:
- uses: MeilCli/setup-crystal-action@v4
with:
crystal_version: latest
shards_version: latest
- name: Run Crystal
run: |
echo 'puts "Hello Crystal"' > hello.cr
crystal run hello.cr
You can also pin to a specific release version in the format @v4.x.x
crystal_version
- required
- install crystal version
- value:
latest
or version value, see crystal-lang/crystal - default:
latest
- warning:
latest
sometimes cannot find crystal binary when immediately after release
shards_version
- required
- install shards version
- value:
latest
orskip
or version value, see crystal-lang/shards- if set
skip
, not install shards
- if set
- default:
latest
github_token
- github token, using get GitHub Release of crystal-lang/crystal or crystal-lang/shards
- default:
${{ github.token }}
cache_mode
- cache mode
- value:
none
,tool-cache
orcache
- default:
cache
tool-cache
- using: @actions/tool-cache
- works in most cases with Self-Hosted Runner
cache
- using: @actions/cache
- works the same as actions/cache
cache_prefix
- if selected
cache
on cache_mode, option that prefix of cache key - Recommended use when parallel jobs
- if selected
install_root
- if selected
none
orcache
on cache_mode, use directory that dicide at this option - default:
${{ runner.temp }}
- if selected
installed_crystal_json
- installed json that GitHub Release Asset
installed_shards_json
- installed json that GitHub Release
see Contributing.md