Merge pull request #65 from nobodywasishere/nobody/specs #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
specs: | |
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}} | |
name: Crystal ${{ matrix.crystal }} specs on ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal }} | |
- name: Crystal Ameba Linter | |
if: matrix.os == 'ubuntu-latest' | |
uses: crystal-ameba/github-action@v0.9.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: shards install --without-development | |
- name: Run specs | |
run: crystal spec --error-on-warnings --error-trace | |
- name: Run formatting checks | |
if: matrix.os != 'windows-latest' | |
run: | | |
if ! crystal tool format --check; then | |
crystal tool format | |
git diff | |
exit 1 | |
fi |