-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (56 loc) · 1.42 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
52
53
54
55
56
57
58
59
name: Spectator CI
on:
push:
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * 6"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Download source code
uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: latest
- name: Install shards
run: shards install
- name: Format
run: crystal tool format --check
- name: Lint
run: bin/ameba --fail-level warning
test:
name: Test
strategy:
fail-fast: false
matrix:
crystal: # Latest version plus 2 previous.
- latest
- nightly
- "1.11"
- "1.12"
- "1.13"
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Download source code
uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}
- name: Cache shards
uses: actions/cache@v4
with:
path: ~/.cache/shards
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }}
restore-keys: ${{ runner.os }}-shards-
- name: Install shards
run: shards update --ignore-crystal-version
- name: Run tests
run: crystal spec --order=random --error-on-warnings