-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (53 loc) · 1.51 KB
/
main.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
name: Main
on:
push:
branches:
- master
- develop
pull_request:
types:
- opened
- synchronize
jobs:
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set crystal version environement variable
run: echo "CRYSTAL_VERSION=$(cat .crystal-version)" >> $GITHUB_ENV
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ env.CRYSTAL_VERSION }}
- name: Crystal shard cache
uses: actions/cache@v3
with:
path: lib
key: ${{ runner.os }}-shards-${{ hashFiles('**/shard.lock') }}
- name: Install dependencies
run: shards install
- name: Run ameba
run: crystal lib/ameba/bin/ameba.cr
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set crystal version environement variable
run: echo "CRYSTAL_VERSION=$(cat .crystal-version)" >> $GITHUB_ENV
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ env.CRYSTAL_VERSION }}
- name: Crystal shard cache
uses: actions/cache@v3
with:
path: lib
key: ${{ runner.os }}-${{ matrix.crystal }}-shards-${{ hashFiles('**/shard.lock') }}
- name: Install dependencies
run: shards install --production
- name: Run tests
run: crystal spec