Merge pull request #139 from Contrast-Security-OSS/SS-90_otel-telemetry #1179
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: Build and Test | |
| on: | |
| push: | |
| branches: | |
| - '*' # Run on all branches | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: '3.13' | |
| cache: 'pip' # Enable built-in pip caching | |
| # Install uv tool for dependency management | |
| - name: Install uv | |
| shell: bash | |
| run: | | |
| echo "" | |
| echo "📦 Installing uv package manager..." | |
| if [ "$RUNNER_OS" = "Windows" ]; then | |
| pip install uv==0.10.2 > uv-install.log || (cat uv-install.log && exit 1) | |
| else | |
| pip install uv==0.10.2 > /tmp/uv-install.log || (cat /tmp/uv-install.log && exit 1) | |
| fi | |
| echo "✅ uv installed successfully" | |
| # Install dependencies using uv (Linux/macOS) | |
| - name: Install dependencies with uv | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| echo "" | |
| echo "📦 Installing Python packages using uv..." | |
| echo "📎 Using lockfile for deterministic installation" | |
| uv pip sync --system ${{ github.workspace }}/src/requirements.lock > /tmp/uv-output.log || (cat /tmp/uv-output.log && exit 1) | |
| echo "✅ Python dependencies installed successfully" | |
| - name: Run Python linting | |
| shell: bash | |
| run: | | |
| echo "" | |
| echo "🔍 Running Python linting using pre-push hook..." | |
| # Use the pre-push hook as single source of truth for linting | |
| ./hooks/pre-push | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| echo "" | |
| echo "🧪 Running tests using test runner script..." | |
| # Use the test script as single source of truth for testing | |
| ./test/run_tests.sh --skip-install | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |