Move everything to a tick loop #499
Workflow file for this run
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
CheckFormat: | |
if: github.repository != 'grepsedawk/sharded.cr' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.4.0 | |
- uses: oprypin/install-crystal@v1 | |
with: | |
crystal: latest | |
- name: Format | |
run: crystal tool format --check | |
- name: Set up Crystal cache | |
uses: actions/cache@v2.1.7 | |
id: crystal-cache | |
with: | |
path: | | |
~/.cache/crystal | |
bin/ameba | |
lib | |
key: ${{ runner.os }}-crystal-${{ hashFiles('**/shard.yml') }} | |
restore-keys: | | |
${{ runner.os }}-crystal- | |
- name: Install shards | |
if: steps.crystal-cache.outputs.cache-hit != 'true' | |
run: shards check || shards install --ignore-crystal-version | |
- name: Run ameba linter | |
run: ./bin/ameba | |
RunSpecs: | |
if: github.repository != 'grepsedawk/sharded.cr' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
crystal_version: | |
- 1.8.2 | |
- latest | |
experimental: | |
- false | |
steps: | |
- uses: actions/checkout@v2.4.0 | |
- run: | | |
cd spec | |
docker-compose up -d | |
sleep 30 # TODO: Wait for the container to be ready | |
- uses: oprypin/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal_version }} | |
- name: Set up Crystal cache | |
uses: actions/cache@v2.1.7 | |
id: crystal-cache | |
with: | |
path: | | |
~/.cache/crystal | |
bin/ameba | |
lib | |
key: ${{ runner.os }}-crystal-${{ matrix.crystal_version }}-${{ hashFiles('**/shard.yml') }} | |
restore-keys: | | |
${{ runner.os }}-crystal- | |
- name: Install shards | |
if: steps.crystal-cache.outputs.cache-hit != 'true' | |
run: shards check || shards install --ignore-crystal-version | |
- name: Create .env | |
run: touch .env | |
- name: Run tests | |
run: crystal spec || crystal spec || crystal spec |