Add support for unix socket connection #120
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: CI | |
on: | |
push: | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: '0 6 * * 1' # Every monday 6 AM | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
crystal: [1.3.0, latest, nightly] | |
mysql_version: ["5.7"] | |
database_host: ["default", "/tmp/mysql.sock"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal }} | |
- id: setup-mysql | |
uses: shogo82148/actions-setup-mysql@v1 | |
with: | |
mysql-version: ${{ matrix.mysql_version }} | |
- name: Wait for MySQL | |
run: | | |
while ! echo exit | nc localhost 3306; do sleep 5; done # wait mysql to start accepting connections | |
- name: Download source | |
uses: actions/checkout@v4 | |
- name: Install shards | |
run: shards install | |
- name: Run specs (Socket) | |
run: DATABASE_HOST=${{ steps.setup-mysql.outputs.base-dir }}/tmp/mysql.sock crystal spec | |
if: matrix.database_host == '/tmp/mysql.sock' | |
- name: Run specs (Plain TCP) | |
run: crystal spec | |
if: matrix.database_host == 'default' | |
- name: Check formatting | |
run: crystal tool format; git diff --exit-code | |
if: matrix.crystal == 'latest' && matrix.os == 'ubuntu-latest' |