CI #400
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: | |
pull_request: | |
branches: | |
- 'master' | |
schedule: | |
- cron: '15 1 * * *' # Nightly at 01:15 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_spelling: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Spelling | |
uses: crate-ci/typos@v1.25.0 | |
check_format: | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:latest-alpine | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Format | |
run: crystal tool format --check | |
coding_standards: | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Workaround https://github.com/amberframework/micrate/issues/87 | |
- name: Install Lib Dependencies | |
run: apt update && apt upgrade -y && apt install -y libsqlite3-dev | |
- name: Install Dependencies | |
run: shards install | |
- name: Ameba | |
run: ./bin/ameba | |
test: | |
services: | |
postgres: | |
image: postgres:16-alpine | |
env: | |
POSTGRES_USER: blog_test_user | |
POSTGRES_PASSWORD: 'mYAw3s0meB!og' | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 2s | |
--health-timeout 10s | |
--health-retries 5 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
crystal: | |
- latest | |
- nightly | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal }} | |
- name: Install Dependencies | |
run: shards install --skip-postinstall --skip-executables | |
- name: Specs | |
run: crystal spec -Dstrict_multi_assign --order=random --error-on-warnings |