-
-
Notifications
You must be signed in to change notification settings - Fork 37
51 lines (42 loc) · 1.35 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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'