Allow guests to register their responses. #8
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: converge CI | |
on: | |
push: | |
branches: "*" | |
pull_request: | |
branches: "*" | |
jobs: | |
check-format: | |
strategy: | |
fail-fast: false | |
matrix: | |
crystal_version: | |
- 1.13.2 | |
experimental: | |
- false | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal_version }} | |
- name: Format | |
run: crystal tool format --check | |
specs: | |
strategy: | |
fail-fast: false | |
matrix: | |
crystal_version: | |
- 1.13.2 | |
experimental: | |
- false | |
runs-on: ubuntu-latest | |
env: | |
LUCKY_ENV: test | |
DB_HOST: localhost | |
continue-on-error: ${{ matrix.experimental }} | |
services: | |
postgres: | |
image: postgres:14-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal_version }} | |
- name: Set up Crystal cache | |
uses: actions/cache@v4 | |
id: crystal-cache | |
with: | |
path: | | |
~/.cache/crystal | |
lib | |
key: ${{ runner.os }}-crystal-${{ hashFiles('**/shard.lock') }} | |
restore-keys: | | |
${{ runner.os }}-crystal- | |
- name: Install shards | |
if: steps.crystal-cache.outputs.cache-hit != 'true' | |
run: shards check || shards install | |
- name: Build lucky_tasks | |
run: crystal build tasks.cr -o ./lucky_tasks | |
- name: Prepare database | |
run: | | |
./lucky_tasks db.create | |
./lucky_tasks db.migrate | |
./lucky_tasks db.seed.required_data | |
- name: Run tests | |
run: crystal spec |