E2E Tests (Real AWS - OIDC) #69
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
| # .github/workflows/test-e2e.yml | |
| name: E2E Tests (Real AWS - OIDC) | |
| on: | |
| push: | |
| branches: [main, testing_tvm] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 2 * * *' # 02:00 UTC (11:00 JST) | |
| # ✅ NEW: Required for OIDC authentication | |
| permissions: | |
| id-token: write # Required to request OIDC token | |
| contents: read # Required to checkout code | |
| jobs: | |
| # ❌ REMOVED: precheck job - no longer needed with OIDC! | |
| e2e-tests: | |
| name: E2E Tests (Real AWS - OIDC) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # ✅ SIMPLIFIED: No need to check for secrets with OIDC | |
| if: | | |
| github.ref_name == 'main' || | |
| github.ref_name == 'testing_tvm' || | |
| github.event_name == 'workflow_dispatch' || | |
| github.event_name == 'schedule' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| pip3 install --upgrade pip | |
| pip3 install -e ".[test]" | |
| # ✅ CHANGED: OIDC authentication (no secrets!) | |
| - name: Configure AWS credentials (OIDC) | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws-cn:iam::621346161733:role/GitHubActions-TVM-E2E-Role | |
| aws-region: cn-north-1 | |
| # ❌ REMOVED: aws-access-key-id and aws-secret-access-key | |
| - name: Run E2E tests | |
| env: | |
| TEST_BUCKET: t01logs # ✅ SIMPLIFIED: No need for secrets fallback | |
| AWS_REGION: cn-north-1 | |
| run: | | |
| pytest tests/e2e/ -v -m "e2e or real_aws" --tb=short | |
| - name: Upload test logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-test-logs | |
| path: | | |
| *.log | |
| /tmp/*.log | |
| retention-days: 7 | |
| - name: Notify on failure | |
| if: failure() | |
| run: | | |
| echo "::error::E2E tests failed! Check logs for details." |