-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (163 loc) · 5.32 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Check Template
on:
workflow_dispatch:
push:
branches: [ 'main' ]
paths-ignore:
- "**.md"
env:
CARGO_GEN_VERSION: "0.22.0"
jobs:
theme-plugin:
name: Test Theme Plugin
runs-on: ubuntu-latest
env:
PROJECT_NAME: test-theme
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-generate@${{env.CARGO_GEN_VERSION}}
- name: Generate Test
run: |
cargo generate \
--verbose \
--path . \
--name "${{ env.PROJECT_NAME }}" \
-d license='all' \
-d description='Theme Test Description' \
-d plugin_name='Theme Test' \
-d plugin_id='test-theme' \
-d deploy_release=true \
-d plugin_type='Theme' \
-d theme_name='Theme Test'
- run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
# Validaciones para el plugin de tema
if [ ! -f "themes/test-theme.json" ]; then
echo "Theme JSON file not generated"
exit 1
fi
slash-command-plugin:
name: Test Slash Command Plugin
if: false
runs-on: ubuntu-latest
env:
PROJECT_NAME: test-slash
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-generate@${{env.CARGO_GEN_VERSION}}
- name: Generate Test
run: |
cargo generate \
--verbose \
--path . \
--name "${{ env.PROJECT_NAME }}" \
-d license='all' \
-d description='Test Slash Command' \
-d plugin_name='Slash Command Test' \
-d plugin_id='test-slash-command' \
-d deploy_release=true \
-d plugin_type='Slash Command' \
-d slash_command_name='test-slash'
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
# Validaciones para el plugin de slash command
if [ ! -f "src/test-slash.rs" ]; then
echo "Slash command file not generated"
exit 1
fi
cargo check
language-plugin-no-ts:
name: Test Lang Plugin without TreeSitter
runs-on: ubuntu-latest
env:
PROJECT_NAME: test-lang
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-generate@${{env.CARGO_GEN_VERSION}}
- name: Generate Test
run: |
cargo generate \
--verbose \
--path . \
--name "${{ env.PROJECT_NAME }}" \
-d license='all' \
-d description='Lang LSP Test' \
-d plugin_name='Language LSP Test Plugin' \
-d plugin_id='test-lang' \
-d deploy_release=true \
-d plugin_type='Language Server' \
-d lsp_name='test-lang-lsp' \
-d language_name='Lang' \
-d lsp_repo='RustLangES/test-lang-lsp-repo' \
-d use_tree_sitter=false
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
# Validaciones para el plugin de lenguaje sin TreeSitter
if [ ! -f "src/test-lang-lsp.rs" ]; then
echo "Language server file not generated"
exit 1
fi
cargo check
language-plugin-ts:
name: Test Lang Plugin with TreeSitter
runs-on: ubuntu-latest
env:
PROJECT_NAME: test-lang-ts
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-generate@${{env.CARGO_GEN_VERSION}}
- name: Generate Test
run: |
cargo generate \
--verbose \
--path . \
--name "${{ env.PROJECT_NAME }}" \
-d license='all' \
-d description='Lang LSP Test with TS' \
-d plugin_name='Language LSP Test Plugin with TS' \
-d plugin_id='test-lang-ts' \
-d deploy_release=true \
-d plugin_type='Language Server' \
-d lsp_name='test-lang-lsp-ts' \
-d language_name='LangTs' \
-d lsp_repo='RustLangES/test-lang-lsp-repo' \
-d use_tree_sitter=true \
-d ts_repo='RustLangES/test-lang-ts-repo' \
-d ts_commit='433af5e21f3d2a1639a875c1b2df898c596c774e'
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
# Validaciones para el plugin de lenguaje con TreeSitter
if [ ! -f "src/test-lang-lsp-ts.rs" ]; then
echo "Language server file not generated"
exit 1
fi
if grep -q "grammars.LangTs" extension.toml; then
echo "Unexpected TreeSitter configuration found"
exit 1
fi
if ! grep -q "433af5e21f3d2a1639a875c1b2df898c596c774e" extension.toml; then
echo "TreeSitter commit hash not found in configuration"
exit 1
fi
cargo check