@@ -14,32 +14,17 @@ jobs:
1414 matrix :
1515 os : [ubuntu-latest, macos-latest]
1616 crystal : [latest]
17- include :
18- - os : ubuntu-latest
19- crystal-install : |
20- curl -fsSL https://crystal-lang.org/install.sh | sudo bash
21- - os : macos-latest
22- crystal-install : |
23- brew install crystal
2417
2518 name : Test on ${{ matrix.os }} with Crystal ${{ matrix.crystal }}
2619
2720 steps :
2821 - name : Checkout code
29- uses : actions/checkout@v4
30-
31- - name : Install Crystal (Ubuntu)
32- if : matrix.os == 'ubuntu-latest'
33- run : |
34- curl -fsSL https://crystal-lang.org/install.sh | sudo bash
35- crystal version
36-
37- - name : Install Crystal (macOS)
38- if : matrix.os == 'macos-latest'
39- run : |
40- brew install crystal
41- crystal version
22+ uses : actions/checkout@v6
4223
24+ - name : Install Crystal
25+ uses : crystal-lang/install-crystal@v1
26+ with :
27+ crystal : ${{ matrix.crystal }}
4328
4429
4530 - name : Cache shards
@@ -56,29 +41,40 @@ jobs:
5641 run : shards install
5742
5843 - name : Check code formatting
59- run : crystal tool format --check
60- continue-on-error : true
44+ run : crystal tool format --check src spec
6145
62- - name : Run ameba linter
63- run : ./bin/ameba
46+ - name : Run code climate checks
47+ run : ./bin/ameba src/amber_cli/native src/amber_lsp
6448 continue-on-error : true
6549
66- - name : Compile project
67- run : crystal build src/amber_cli.cr --no-debug
50+ - name : Compile CLI
51+ run : crystal build src/amber_cli.cr --no-debug -o amber
52+
53+ - name : Compile LSP
54+ run : crystal build src/amber_lsp.cr --no-debug -o amber-lsp
55+
56+ - name : Build LSP binary for integration specs
57+ run : |
58+ mkdir -p bin
59+ crystal build src/amber_lsp.cr --no-debug -o bin/amber-lsp
6860
6961 - name : Run tests
7062 run : crystal spec
7163
72- - name : Build release binary
73- run : crystal build src/amber_cli.cr --release --no-debug -o amber_cli
64+ - name : Build release binaries
7465 if : matrix.os == 'ubuntu-latest'
66+ run : |
67+ crystal build src/amber_cli.cr --release --no-debug -o amber_cli
68+ crystal build src/amber_lsp.cr --release --no-debug -o amber_lsp
7569
76- - name : Upload binary artifact (Linux)
77- uses : actions/upload-artifact@v4
70+ - name : Upload binary artifacts (Linux)
71+ uses : actions/upload-artifact@v7
7872 if : matrix.os == 'ubuntu-latest'
7973 with :
80- name : amber_cli-linux
81- path : amber_cli
74+ name : amber-cli-linux
75+ path : |
76+ amber_cli
77+ amber_lsp
8278
8379 # Separate job for additional platform-specific tests
8480 platform-specific :
@@ -92,17 +88,12 @@ jobs:
9288
9389 steps :
9490 - name : Checkout code
95- uses : actions/checkout@v4
96-
97- - name : Install Crystal (Ubuntu)
98- if : matrix.os == 'ubuntu-latest'
99- run : |
100- curl -fsSL https://crystal-lang.org/install.sh | sudo bash
91+ uses : actions/checkout@v6
10192
102- - name : Install Crystal (macOS)
103- if : matrix.os == 'macos-latest'
104- run : |
105- brew install crystal
93+ - name : Install Crystal
94+ uses : crystal-lang/install-crystal@v1
95+ with :
96+ crystal : latest
10697
10798 - name : Install dependencies
10899 run : shards install
@@ -113,6 +104,11 @@ jobs:
113104 ./amber_cli --help || true
114105 ./amber_cli --version || true
115106
107+ - name : Test LSP functionality
108+ run : |
109+ crystal build src/amber_lsp.cr -o amber_lsp
110+ test -x ./amber_lsp
111+
116112 # Job to run integration tests
117113 integration :
118114 runs-on : ubuntu-latest
@@ -121,11 +117,12 @@ jobs:
121117
122118 steps :
123119 - name : Checkout code
124- uses : actions/checkout@v4
120+ uses : actions/checkout@v6
125121
126122 - name : Install Crystal
127- run : |
128- curl -fsSL https://crystal-lang.org/install.sh | sudo bash
123+ uses : crystal-lang/install-crystal@v1
124+ with :
125+ crystal : latest
129126
130127 - name : Install dependencies
131128 run : shards install
@@ -136,4 +133,4 @@ jobs:
136133 crystal spec spec/integration/
137134 else
138135 echo "No integration tests found, skipping..."
139- fi
136+ fi
0 commit comments