Skip to content

ci: add check workflows #1

ci: add check workflows

ci: add check workflows #1

Workflow file for this run

name: Check Template
on:
workflow_dispatch:
pull_request:
push:
branches: [ 'main' ]
paths-ignore:
- "**.md"
jobs:
theme-plugin:
name: Test Theme Plugin
runs-on: ubuntu-latest
env:
PROJECT_NAME: test-theme
steps:
- uses: actions/checkout@v4
- uses: cargo-generate/cargo-generate-action@latest
with:
name: ${{ env.PROJECT_NAME }}
license: all
description: Theme Test Description
plugin_name: Theme Test
plugin_id: test-theme
deploy_release: true
plugin_type: Theme
theme_name: Theme Test
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- 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
runs-on: ubuntu-latest
env:
PROJECT_NAME: test-slash
steps:
- uses: actions/checkout@v4
- uses: cargo-generate/cargo-generate-action@latest
with:
name: ${{ env.PROJECT_NAME }}
license: all
description: Test Slash Command
plugin_name: Slash Command Test
plugin_id: test-slash-command
deploy_release: true
plugin_type: Slash Command
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: cargo-generate/cargo-generate-action@latest
with:
name: ${{ env.PROJECT_NAME }}
license: all
description: Lang LSP Test
plugin_name: Language LSP Test Plugin
plugin_id: test-lang
deploy_release: true
plugin_type: Language Server
lsp_name: test-lang-lsp
language_name: Lang
lsp_repo: RustLangES/test-lang-lsp-repo
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
if grep -q "tree_sitter" extension.toml; then
echo "Unexpected TreeSitter configuration found"
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: cargo-generate/cargo-generate-action@latest
with:
name: ${{ env.PROJECT_NAME }}
license: all
description: Lang LSP Test with TS
plugin_name: Language LSP Test Plugin with TS
plugin_id: test-lang-ts
deploy_release: true
plugin_type: Language Server
lsp_name: test-lang-lsp-ts
language_name: LangTs
lsp_repo: RustLangES/test-lang-lsp-repo
use_tree_sitter: true
ts_repo: RustLangES/test-lang-ts-repo
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 "tree_sitter" extension.toml; then
echo "TreeSitter configuration not found"
exit 1
fi
if ! grep -q "433af5e21f3d2a1639a875c1b2df898c596c774e" extension.toml; then
echo "TreeSitter commit hash not found in configuration"
exit 1
fi
cargo check