62f0c575/14/2026, 9:47:06 AM
.yml
YAML
(text/x-yaml)
name: CI
on:
  push:
jobs:
  style:
    runs-on: ubuntu-latest
    container:
      image: crystallang/crystal
    steps:
      - uses: actions/checkout@v2
      - name: Format
        run: crystal tool format --check
      - name: Lint
        uses: crystal-ameba/github-action@v0.2.12
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        crystal:
          - latest
          - nightly
          - 1.0.0
          - 0.36.1
    steps:
      - uses: oprypin/install-crystal@v1
        with:
         crystal: ${{ matrix.crystal }}
      - uses: actions/checkout@v2
      - run: shards install
      - name: Tests
        run: crystal spec --error-trace -v --order=random --no-color

  publish:
    if: contains('refs/heads/master', github.ref)
    needs: test
    runs-on: ubuntu-latest
    container:
      image: crystallang/crystal
    steps:
      - uses: actions/checkout@v2
      - run: shards install
      - name: Generate documentation
        run: crystal docs
      - name: Deploy to GitHub Pages
        uses: crazy-max/ghaction-github-pages@v2
        with:
          target_branch: gh-pages
          build_dir: docs
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}