-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.09 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
specs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
crystal: [1.15.0]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
with:
tree-sitter-ref: latest
- name: Build tree-sitter shared library
run: |
git clone https://github.com/tree-sitter/tree-sitter.git
cd tree-sitter
make
sudo make install
- name: Build tree-sitter-json shared library
run: |
git clone https://github.com/tree-sitter/tree-sitter-json.git
cd tree-sitter-json
make
sudo make install
- name: Set up Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{matrix.crystal}}
- name: Run Crystal specs
run: crystal spec -p -s
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
crystal: [1.15.0]
ameba-version: [v1.6.4]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{matrix.crystal}}
- name: Cache Ameba binary
id: cache-ameba
uses: actions/cache@v3
with:
path: bin/ameba
key: ${{ matrix.os }}-ameba-${{ matrix.ameba-version }}-${{ matrix.crystal }}
- name: Build Ameba
if: steps.cache-ameba.outputs.cache-hit != 'true'
run: |
git clone --branch ${{ matrix.ameba-version }} --single-branch https://github.com/crystal-ameba/ameba.git
cd ameba
make bin/ameba CRFLAGS='-Dpreview_mt --release --no-debug'
mkdir -p ../bin
mv bin/ameba ../bin/ameba
cd ..
rm -rf ameba
- name: Run Ameba Linter
run: bin/ameba -c .ameba.yml