diff options
Diffstat (limited to '.gitea/workflows/ci.yaml')
| -rw-r--r-- | .gitea/workflows/ci.yaml | 100 |
1 files changed, 98 insertions, 2 deletions
diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 4c181ca..a5e2ca9 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,12 +1,17 @@ name: CI Pipeline -on: [push, pull_request] +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + workflow_dispatch: jobs: shasums: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run shasums script run: | cp -rv ./hyperterm/ "$HOME/.hyperterm/" @@ -79,6 +84,11 @@ jobs: shellcheck hyperterm/tools/sysinfo.sh shellcheck hyperterm/tools/virtualenv.sh + - name: Run shellcheck on test scripts + run: | + shellcheck tests/test_prompt.sh + shellcheck tests/quick_test.sh + - name: Run shellcheck on install script run: shellcheck install.sh @@ -90,3 +100,89 @@ jobs: - name: Run uninstall script run: bash -x uninstall.sh -s + + tests: + runs-on: ubuntu-latest + needs: build + env: + CI: true + steps: + - uses: actions/checkout@v4 + + - name: Set up git configuration for tests + run: | + git config --global user.name "CI Test User" + git config --global user.email "ci-test@example.com" + + - name: Install dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y git bash + + - name: Run quick prompt test + run: | + echo "INFO: Running quick prompt test" + bash tests/quick_test.sh + + - name: Run comprehensive prompt test + run: | + echo "INFO: Running comprehensive prompt test" + # Run in non-interactive mode for CI + bash tests/test_prompt.sh --non-interactive + + - name: Test prompt in current repository + run: | + echo "INFO: Testing prompt in current git repository" + # Create test changes to verify git status detection + echo "test change for CI" >> README.md + echo "untracked CI test file" > ci_test_file.txt + + # Test using our quick test (which already handles sourcing correctly) + echo "Running quick test to verify prompt works in CI environment..." + bash tests/quick_test.sh + + - name: Validate optimizations + run: | + echo "INFO: Validating optimizations" + + # Check that git_optimized.sh doesn't exist (should be integrated into git.sh) + if [[ -f "hyperterm/core/git_optimized.sh" ]]; then + echo "ERROR: git_optimized.sh should not exist (should be integrated)" + exit 1 + fi + + # Check that git.sh exists and is optimized + if [[ ! -f "hyperterm/core/git.sh" ]]; then + echo "ERROR: git.sh not found" + exit 1 + fi + + # Verify the optimized functions exist using bash + if ! bash -c 'source hyperterm/core/git.sh && command -v _get_git_status_fast >/dev/null 2>&1'; then + echo "ERROR: Optimized function _get_git_status_fast not found" + exit 1 + fi + + echo "SUCCESS: Optimizations validated" + + performance: + runs-on: ubuntu-latest + needs: tests + steps: + - uses: actions/checkout@v4 + + - name: Set up git configuration + run: | + git config --global user.name "Performance Test" + git config --global user.email "perf-test@example.com" + + - name: Performance benchmark + run: | + echo "INFO: Running performance benchmark using existing test suite" + + # The comprehensive test already includes performance testing + # Run it again to get performance metrics in CI logs + bash tests/test_prompt.sh --non-interactive + + echo "INFO: Performance benchmark completed" + echo "NOTE: Detailed performance metrics are included in the comprehensive test output above" |
