feat: integrate RTK (Rust Token Killer) for LLM token optimization (Copilot + OpenCode) #1046
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Sjust Installation | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| jobs: | |
| test-sjust: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-15, macos-26] | |
| env: | |
| TERM: xterm-256color | |
| SHELL: /bin/zsh | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup sparkdock directory | |
| run: | | |
| echo "Creating /opt/sparkdock directory and copying files..." | |
| sudo mkdir -p /opt/sparkdock | |
| sudo cp -R . /opt/sparkdock/ | |
| sudo chown -R $(whoami):staff /opt/sparkdock | |
| echo "Verifying sparkdock directory structure..." | |
| ls -la /opt/sparkdock/sjust/ | |
| - name: Install Just command runner | |
| run: | | |
| echo "Installing Just command runner..." | |
| brew install just | |
| - name: Test sjust library files syntax | |
| run: | | |
| echo "Testing libcolors.sh syntax..." | |
| /bin/zsh -n sjust/libs/libcolors.sh | |
| echo "Testing libformatting.sh syntax..." | |
| /bin/zsh -n sjust/libs/libformatting.sh | |
| echo "Testing sjust.sh syntax..." | |
| /bin/zsh -n sjust/sjust.sh | |
| - name: Test Just recipe files syntax | |
| run: | | |
| echo "Testing main justfile syntax..." | |
| just --justfile sjust/justfile --dry-run --list > /dev/null | |
| echo "Testing individual recipe files..." | |
| just --justfile sjust/recipes/00-default.just --dry-run --list > /dev/null | |
| just --justfile sjust/recipes/01-lima.just --dry-run --list > /dev/null | |
| - name: Test make install-sjust with git check disabled | |
| run: | | |
| echo "Testing make install-sjust command..." | |
| cd /opt/sparkdock | |
| # Run install-sjust with git check disabled | |
| SKIP_GIT_CHECK=1 make install-sjust | |
| echo "Testing sjust command is available..." | |
| which sjust | |
| echo "Testing sjust can list commands without errors..." | |
| sjust --list | |
| - name: Test zsh completion generation | |
| run: | | |
| echo "Testing zsh completion for sjust..." | |
| # Check if completion file was created | |
| BREW_PREFIX=$(brew --prefix 2>/dev/null || echo "/usr/local") | |
| COMPLETION_FILE="$BREW_PREFIX/share/zsh/site-functions/_sjust" | |
| if [ -f "$COMPLETION_FILE" ]; then | |
| echo "✅ Completion file created at: $COMPLETION_FILE" | |
| echo "Checking completion file content..." | |
| cat "$COMPLETION_FILE" | |
| # Verify compdef targets sjust | |
| if head -1 "$COMPLETION_FILE" | grep -q '#compdef sjust'; then | |
| echo "✅ Completion file has correct #compdef sjust header" | |
| else | |
| echo "❌ Completion file missing #compdef sjust header" | |
| exit 1 | |
| fi | |
| # Verify it defines an _sjust function with scoped JUST_JUSTFILE | |
| if grep -q '_sjust()' "$COMPLETION_FILE"; then | |
| echo "✅ Completion file defines _sjust() function" | |
| else | |
| echo "❌ Completion file does not define _sjust() function" | |
| exit 1 | |
| fi | |
| # Verify JUST_JUSTFILE is scoped to the subprocess (not exported globally) | |
| if grep -q 'JUST_JUSTFILE="/opt/sparkdock/sjust/Justfile"' "$COMPLETION_FILE" && ! grep -q 'export JUST_JUSTFILE' "$COMPLETION_FILE"; then | |
| echo "✅ JUST_JUSTFILE is correctly scoped to subprocess" | |
| else | |
| echo "❌ JUST_JUSTFILE should be scoped, not exported" | |
| exit 1 | |
| fi | |
| else | |
| echo "❌ Completion file not found at: $COMPLETION_FILE" | |
| exit 1 | |
| fi | |
| - name: Test library functions can be sourced | |
| run: | | |
| echo "Testing that library files can be sourced without errors..." | |
| # Test sourcing libcolors.sh | |
| /bin/zsh -c "source sjust/libs/libcolors.sh && echo 'libcolors.sh sourced successfully'" | |
| # Test sourcing libformatting.sh | |
| /bin/zsh -c "source sjust/libs/libformatting.sh && echo 'libformatting.sh sourced successfully'" | |
| # Test that functions are available after sourcing | |
| /bin/zsh -c "source sjust/libs/libformatting.sh && echo 'Testing Urllink function:' && Urllink 'https://example.com' 'Example Link'" | |
| - name: Test specific sjust commands (dry-run mode) | |
| run: | | |
| echo "Testing specific sjust commands in dry-run mode..." | |
| # Test that device-info command can be parsed (dry-run) | |
| sjust --dry-run system-device-info | |
| # Test that docker-ps command can be parsed (dry-run) | |
| sjust --dry-run docker-ps | |
| # Test that upgrade-system command can be parsed (dry-run) | |
| sjust --dry-run system-upgrade | |
| - name: Test sjust with non-interactive environment | |
| env: | |
| NON_INTERACTIVE: "true" | |
| run: | | |
| echo "Testing sjust works in non-interactive environment..." | |
| sjust --list > /dev/null | |
| echo "✅ Sjust works correctly in non-interactive mode" | |
| - name: Test sjust recipe imports | |
| run: | | |
| echo "Testing that recipe imports work correctly..." | |
| # Verify that the main justfile can import all recipes | |
| just --justfile sjust/justfile --evaluate > /dev/null | |
| echo "✅ All recipe imports work correctly" | |
| - name: Clean up test installations | |
| if: always() | |
| run: | | |
| echo "Cleaning up..." | |
| sudo rm -f /usr/local/bin/sjust | |
| # Clean up completion file | |
| BREW_PREFIX=$(brew --prefix 2>/dev/null || echo "/usr/local") | |
| sudo rm -f "$BREW_PREFIX/share/zsh/site-functions/_sjust" | |
| # Clean up sparkdock directory | |
| sudo rm -rf /opt/sparkdock |