Misc improvements #117
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: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
Tests: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/battlesnake-test | |
KEMAL_ENV: test | |
LOG_LEVEL: WARN | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Download source | |
uses: actions/checkout@v3 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
- name: Cache shards | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/shards | |
key: shards-${{ hashFiles('shard.yml') }} | |
restore-keys: ${{ runner.os }}-shards- | |
- name: Install shards | |
run: shards update | |
- name: Setup DB | |
run: make sam db:setup | |
- name: Run tests | |
run: make sam test |