Skip to content

chore: refresh quickstart JSON files #123

chore: refresh quickstart JSON files

chore: refresh quickstart JSON files #123

Workflow file for this run

name: Test Suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
# Fast parallel Linux tests on self-hosted runners
test-linux-unit:
runs-on: [self-hosted, linux]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Verify BATS installation
run: |
if [[ ! -f tests/bats/bin/bats ]]; then
git submodule update --init --recursive
fi
tests/bats/bin/bats --version
- name: Run unit tests
run: |
cd tests
./run_tests.sh --unit-only
test-linux-integration:
runs-on: [self-hosted, linux]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Verify BATS installation
run: |
if [[ ! -f tests/bats/bin/bats ]]; then
git submodule update --init --recursive
fi
tests/bats/bin/bats --version
- name: Run integration tests
run: |
cd tests
./run_tests.sh --integration-only
test-linux-system:
runs-on: [self-hosted, linux]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Verify BATS installation
run: |
if [[ ! -f tests/bats/bin/bats ]]; then
git submodule update --init --recursive
fi
tests/bats/bin/bats --version
- name: Run system tests
run: |
cd tests
./run_tests.sh --system-only
- name: Test installation script
run: |
export INSTALL_DIR="$GITHUB_WORKSPACE/test-install"
mkdir -p "$INSTALL_DIR"
sed 's|/usr/local/bin|'"$INSTALL_DIR"'|g' install.sh > test-install.sh
chmod +x test-install.sh
./test-install.sh --offline ./llm-env
test -x "$INSTALL_DIR/llm-env"
"$INSTALL_DIR/llm-env" --version
# macOS tests on GitHub-hosted runners (need actual macOS)
test-macos:
runs-on: macos-latest
strategy:
matrix:
shell: [bash, zsh]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up shell environment
run: |
# Install newer bash on macOS (default is 3.2.57)
brew install bash || true
echo "/opt/homebrew/bin" >> $GITHUB_PATH
if [[ "${{ matrix.shell }}" == "zsh" ]]; then
brew install zsh || true
fi
- name: Debug environment information
run: |
echo "=== Environment Debug Information ==="
echo "Shell: ${{ matrix.shell }}"
echo "Default bash version: $BASH_VERSION"
if [[ -x "/opt/homebrew/bin/bash" ]]; then
echo "Homebrew bash version: $(/opt/homebrew/bin/bash --version | head -1)"
fi
- name: Verify BATS installation
run: |
if [[ ! -f tests/bats/bin/bats ]]; then
git submodule update --init --recursive
fi
tests/bats/bin/bats --version
- name: Run unit tests
run: |
cd tests
if [[ -x "/opt/homebrew/bin/bash" ]] && [[ "${{ matrix.shell }}" == "bash" ]]; then
SHELL=/opt/homebrew/bin/bash ./run_tests.sh --unit-only
else
SHELL=/bin/${{ matrix.shell }} ./run_tests.sh --unit-only
fi
- name: Run integration tests
run: |
cd tests
if [[ -x "/opt/homebrew/bin/bash" ]] && [[ "${{ matrix.shell }}" == "bash" ]]; then
SHELL=/opt/homebrew/bin/bash ./run_tests.sh --integration-only
else
SHELL=/bin/${{ matrix.shell }} ./run_tests.sh --integration-only
fi
- name: Run system tests
run: |
cd tests
if [[ -x "/opt/homebrew/bin/bash" ]] && [[ "${{ matrix.shell }}" == "bash" ]]; then
SHELL=/opt/homebrew/bin/bash ./run_tests.sh --system-only
else
SHELL=/bin/${{ matrix.shell }} ./run_tests.sh --system-only
fi
- name: Test installation script
run: |
export INSTALL_DIR="$GITHUB_WORKSPACE/test-install"
mkdir -p "$INSTALL_DIR"
sed 's|/usr/local/bin|'"$INSTALL_DIR"'|g' install.sh > test-install.sh
chmod +x test-install.sh
./test-install.sh --offline ./llm-env
test -x "$INSTALL_DIR/llm-env"
"$INSTALL_DIR/llm-env" --version
lint:
runs-on: [self-hosted, linux]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install ShellCheck
run: |
if ! command -v shellcheck &> /dev/null; then
sudo apt-get update
sudo apt-get install -y shellcheck
fi
- name: Run ShellCheck on main script
run: shellcheck llm-env
- name: Run ShellCheck on installer
run: shellcheck install.sh
- name: Run ShellCheck on test runner
run: shellcheck tests/run_tests.sh
scraper-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Run scraper unit tests
run: python -m pytest scripts/tests/ -v --cov=scripts.lib --cov=scripts.update_quickstart --cov-report=term
security:
runs-on: [self-hosted, linux]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for secrets in code
run: |
if grep -r -E "(api[_-]key|API[_-]KEY)\s*=\s*['\"][a-zA-Z0-9_-]{20,}['\"]" . --exclude-dir=.git --exclude-dir=tests --exclude="*.md" --exclude-dir=examples; then
echo "WARNING: Potential API keys found in code"
exit 1
fi
- name: Check file permissions
run: |
find . -type f \( -perm -002 -o -perm -020 \) -not -path "./.git/*" | head -10
- name: Validate configuration files
run: |
if [[ -f config/llm-env.conf ]]; then
if ! grep -q "^\[.*\]$" config/llm-env.conf; then
echo "ERROR: Invalid configuration file format"
exit 1
fi
fi