FCC Benchmark Demo [DRAFT] #12
Workflow file for this run
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
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # SPDX-License-Identifier: MIT-0 | |
| name: Developer Tests | |
| on: | |
| pull_request: | |
| branches: | |
| - '**' # Run on PR open, update, or synchronize (i.e., any push to PR branch) | |
| # Global timeout for all jobs | |
| # Note: GitHub Actions uses minutes, GitLab uses duration strings | |
| jobs: | |
| developer_tests: | |
| name: Lint, Type Check, and Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 # 2 hours | |
| # Use Python 3.13 to match GitLab configuration | |
| container: | |
| image: python:3.13-bookworm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for git diff in typecheck-pr | |
| - name: Set up Git safe directory | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Fetch base branch | |
| run: | | |
| git fetch origin ${{ github.base_ref || 'main' }}:refs/remotes/origin/${{ github.base_ref || 'main' }} | |
| git branch -a | |
| - name: Set up environment | |
| run: | | |
| python --version | |
| apt-get update -y | |
| apt-get install make curl -y | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Create virtual environment | |
| run: | | |
| uv venv .venv | |
| echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH | |
| - name: Install Node.js and basedpyright | |
| run: | | |
| curl -fsSL https://deb.nodesource.com/setup_20.x | bash - | |
| apt-get install -y nodejs | |
| npm install -g basedpyright | |
| - name: Install Python dependencies | |
| run: | | |
| uv pip install ruff | |
| uv pip install typer rich boto3 | |
| cd lib/idp_common_pkg && uv pip install -e ".[test]" && cd ../.. | |
| - name: Run linting checks | |
| run: make lint-cicd | |
| - name: Run type checking | |
| run: | | |
| TARGET_BRANCH="${{ github.base_ref }}" | |
| echo "=== Type Checking Configuration ===" | |
| echo "PR target branch (github.base_ref): $TARGET_BRANCH" | |
| echo "Comparing: origin/$TARGET_BRANCH...HEAD" | |
| echo "====================================" | |
| echo "" | |
| python3 scripts/typecheck_pr_changes.py "$TARGET_BRANCH" | |
| - name: Run tests | |
| id: run-tests | |
| run: make test-cicd -C lib/idp_common_pkg | |
| continue-on-error: false | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() && steps.run-tests.outcome != 'skipped' | |
| with: | |
| name: test-reports | |
| path: | | |
| lib/idp_common_pkg/test-reports/coverage.xml | |
| lib/idp_common_pkg/test-reports/test-results.xml | |
| retention-days: 7 | |
| - name: Publish test results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() && hashFiles('lib/idp_common_pkg/test-reports/test-results.xml') != '' | |
| with: | |
| files: lib/idp_common_pkg/test-reports/test-results.xml | |
| check_name: Test Results | |
| - name: Code Coverage Report | |
| uses: irongut/[email protected] | |
| if: always() && hashFiles('lib/idp_common_pkg/test-reports/coverage.xml') != '' | |
| with: | |
| filename: lib/idp_common_pkg/test-reports/coverage.xml | |
| badge: true | |
| fail_below_min: false | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: true | |
| indicators: true | |
| output: both | |
| thresholds: '60 80' | |
| # Note: PR comments disabled for fork PRs due to permission restrictions | |
| # Coverage results are available in: | |
| # 1. Workflow artifacts (test-reports) | |
| # 2. Job summary (automatically generated by CodeCoverageSummary) | |
| # 3. GitHub checks tab |