Skip to content

Shard CI

Shard CI #238

Workflow file for this run

name: Shard CI
on:
push:
branches:
- master
pull_request:
branches:
- "*"
schedule:
- cron: "0 3 * * MON"
jobs:
LintAndTest:
strategy:
fail-fast: false
matrix:
crystal_version:
- 1.5.0
- latest
experimental: [false]
include:
- crystal_version: nightly
experimental: true
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v4
- uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal_version }}
- name: Check format
run: crystal tool format --check
if: matrix.crystal_version == 'latest'
- name: Set up Crystal cache
uses: actions/cache@v4
id: crystal-cache
with:
path: |
~/.cache/crystal
bin/ameba
lib
key: ${{ runner.os }}-crystal-${{ matrix.crystal_version }}-${{ hashFiles('**/shard.lock') }}
restore-keys: |
${{ runner.os }}-crystal-${{ matrix.crystal_version }}
- name: Install shards
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: shards check || shards install --ignore-crystal-version
- name: Crystal Ameba Linter
run: ./bin/ameba
if: matrix.crystal_version == 'latest'
- name: Run tests
run: crystal spec