Skip to content

.github/workflows/ci.yml #65

.github/workflows/ci.yml

.github/workflows/ci.yml #65

Workflow file for this run

on:
push:
branches: [main]
pull_request:
schedule:
- cron: "4 20 * * 6"
jobs:
build:
strategy:
fail-fast: false
matrix:
crystal: ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", latest, nightly]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Download source
uses: actions/checkout@v3
- name: Setup x86 libyaml for Crystal 1.0
if: "matrix.crystal == '1.0' && matrix.os == 'macos-latest'"
run: |
# Install x86_64 Homebrew if not present
if [ ! -f /usr/local/bin/brew ]; then
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Install libyaml using x86_64 Homebrew
arch -x86_64 /usr/local/bin/brew install libyaml
sudo mkdir -p /opt/crystal/embedded/lib
sudo ln -sf $(/usr/local/bin/brew --prefix libyaml)/lib/libyaml-0.2.dylib /opt/crystal/embedded/lib/libyaml-0.2.dylib
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}
- name: Check formatting
if: "matrix.crystal == 'latest' && matrix.os == 'ubuntu-latest'"
run: crystal tool format --check
- name: Run tests
run: crystal spec