Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 75 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# ecs is a CovScript-to-CovScript transpiler. This CI:
# 1. Downloads a pre-built CovScript SDK from csbuild releases
# 2. Configures cspkg to use the bundled package repository
# 3. Installs remote dependencies (parsergen, regex, codec, sdk_extension)
# 4. Builds and installs ecs/ecs_parser/ecs_generator/ecs_bootstrap from local source
# 5. Runs non-interactive unit tests in unit_tests/
# 3. Builds parsergen_cxx (C++ parser extension) from source
# 4. Installs remote dependencies (parsergen, regex, codec, sdk_extension)
# 5. Builds and installs ecs/ecs_parser/ecs_generator/ecs_bootstrap from local source
# 6. Runs non-interactive unit tests in unit_tests/

name: CI

Expand Down Expand Up @@ -122,6 +123,49 @@ jobs:
CS_HOME="${{ steps.sdk.outputs.cs_home }}"
echo "COVSCRIPT_HOME=${CS_HOME}" >> "$GITHUB_ENV"
echo "${CS_HOME}/bin" >> "$GITHUB_PATH"
echo "PARSERGEN_IMPL=parsergen_cxx" >> "$GITHUB_ENV"

# ------------------------------------------------------------------ #
# 5.5. Build parsergen_cxx from source #
# ------------------------------------------------------------------ #
- name: Checkout parsergen
uses: actions/checkout@v5
with:
repository: mikecovlee/parsergen
ref: cxx_impl
path: parsergen-src
submodules: recursive

- name: Build parsergen_cxx (Unix)
if: runner.os != 'Windows'
shell: bash
env:
CS_DEV_PATH: ${{ steps.sdk.outputs.cs_home }}/
run: |
mkdir -p parsergen-src/cpp/build && cd parsergen-src/cpp/build
cmake -G "Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target parsergen_cni --parallel 4
mkdir -p ../../build/imports
cp parsergen_cxx.cse ../../build/imports/

- name: Build parsergen_cxx (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake make
path-type: inherit

- name: Build parsergen_cxx (Windows build)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
export CS_DEV_PATH="$(cygpath -u "${{ steps.sdk.outputs.cs_home }}")/"
mkdir -p parsergen-src/cpp/build && cd parsergen-src/cpp/build
cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build . --target parsergen_cni -- -j4
mkdir -p ../../build/imports
cp parsergen_cxx.cse ../../build/imports/

# ------------------------------------------------------------------ #
# 6. Install remote dependencies + build local packages #
Expand All @@ -138,10 +182,29 @@ jobs:
cspkg build . --install --yes
# Fix dependencies
cspkg install --fix --yes
# Install parsergen_cxx extension + updated parsergen (built from source
# in step 5.5). Done after 'install --fix' so the newer parsergen is
# not reverted to the older cspkg-repo version.
cspkg build parsergen-src --install parsergen_cxx parsergen --yes
echo ""
echo "=== Installed packages ==="
cspkg list

# ------------------------------------------------------------------ #
# 6.5. Grammar static analysis #
# Uses the CovScript parsergen (PARSERGEN_IMPL=parsergen): the #
# analyzer is a CovScript package designed for the script-built #
# grammar structure. #
# ------------------------------------------------------------------ #
- name: Grammar analysis
shell: bash
env:
PARSERGEN_IMPL: parsergen
run: |
echo "=== Grammar Static Analysis ==="
cspkg install parsergen_analysis --yes
cs misc/check_grammar.csc

# ------------------------------------------------------------------ #
# 7. Run unit tests #
# ------------------------------------------------------------------ #
Expand Down Expand Up @@ -187,3 +250,12 @@ jobs:
run: |
echo "=== Formatter Correctness Tests ==="
bash format_tests/run.sh

# ------------------------------------------------------------------ #
# 10. Error recovery tests #
# ------------------------------------------------------------------ #
- name: Error recovery tests
shell: bash
run: |
echo "=== Error Recovery Tests ==="
bash tests/run_recovery.sh
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.ecs_output/
cspkg-repo/
cspkg-repo/
imports/parsergen_cxx.cse
2 changes: 1 addition & 1 deletion csbuild/ecs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "ecs",
"Info": "Extended CovScript(ECS Lang) Header",
"Author": "Michael Lee",
"Version": "1.4.2",
"Version": "1.4.3",
"Target": "imports/ecs.csp",
"Dependencies": [
"sdk_extension"
Expand Down
2 changes: 1 addition & 1 deletion csbuild/ecs_bootstrap.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "ecs_bootstrap",
"Info": "Extended CovScript(ECS Lang) Bootstrap",
"Author": "Michael Lee",
"Version": "1.7.1",
"Version": "1.8.0",
"Target": "imports/ecs_bootstrap.csp",
"Dependencies": [
"parsergen",
Expand Down
2 changes: 1 addition & 1 deletion csbuild/ecs_generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "ecs_generator",
"Info": "Extended CovScript(ECS Lang) Generator",
"Author": "Michael Lee",
"Version": "4.1.0.3",
"Version": "4.1.0.4",
"Target": "imports/ecs_generator.csp",
"Dependencies": [
"parsergen",
Expand Down
2 changes: 1 addition & 1 deletion csbuild/ecs_parser.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "ecs_parser",
"Info": "Extended CovScript(ECS Lang) Parser",
"Author": "Michael Lee",
"Version": "1.4.0",
"Version": "1.4.1",
"Target": "imports/ecs_parser.csp",
"Dependencies": [
"parsergen",
Expand Down
4 changes: 2 additions & 2 deletions ecs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env cs
#
# Extended Covariant Script Launcher v1.0.0
# Extended Covariant Script Launcher v1.0.1
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright (C) 2017-2025 Michael Lee(李登淳)
# Copyright (C) 2017-2026 Michael Lee(李登淳)
#
# Email: mikecovlee@163.com
# Github: https://github.com/mikecovlee
Expand Down
6 changes: 3 additions & 3 deletions imports/ecs.csp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Extended Covariant Script Header: v1.4.2
# Extended Covariant Script Header: v1.4.3
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a clone of the License at
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# cloneright (C) 2017-2026 Michael Lee(李登淳)
# Copyright (C) 2017-2026 Michael Lee(李登淳)
#
# Email: mikecovlee@163.com
# Github: https://github.com/mikecovlee
Expand Down
Loading
Loading