docs: fix pyproject.toml license field LGPL-3.0-or-later -> Apache-2.0 #70
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r src/main/python/requirements-dev.txt | |
| - name: flake8 | |
| run: flake8 src/main/python/ src/test/python/ --max-line-length=120 --count --show-source --statistics | |
| - name: mypy | |
| run: mypy src/main/python/taf/ --ignore-missing-imports | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r src/main/python/requirements-dev.txt | |
| - name: Set up SSH for CLI tests | |
| run: | | |
| sudo systemctl start ssh || sudo systemctl start sshd || true | |
| ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" | |
| cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys | |
| chmod 600 ~/.ssh/authorized_keys | |
| ssh-keyscan -H localhost >> ~/.ssh/known_hosts 2>/dev/null | |
| ssh -o BatchMode=yes localhost whoami | |
| - name: Run unit tests | |
| run: | | |
| PYTHONPATH=src/main/python pytest src/test/python/ut/ -v --tb=short \ | |
| --junitxml=reports/unit-tests.xml \ | |
| --cov=taf --cov-report=xml:reports/coverage.xml --cov-report=term-missing | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: reports/unit-tests.xml | |
| - name: Upload coverage | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: reports/coverage.xml | |
| contract: | |
| name: API Contract Validation | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r src/main/python/requirements-dev.txt | |
| pip install ".[httpx]" | |
| - name: Validate OpenAPI schema exists and is valid JSON | |
| run: | | |
| PYTHONPATH=src/main/python python -c " | |
| import json, pathlib | |
| schema = pathlib.Path('src/test/python/suites/agentic/contract/schemas/openapi.json') | |
| assert schema.exists(), f'OpenAPI schema not found: {schema}' | |
| data = json.loads(schema.read_text()) | |
| assert 'paths' in data, 'OpenAPI schema missing paths' | |
| print(f'OpenAPI schema valid: {len(data[\"paths\"])} paths') | |
| " | |
| build: | |
| name: Build Wheel | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Build wheel | |
| run: python -m build --wheel --outdir dist/ | |
| - name: Upload artifact | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/*.whl | |
| docker: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| packages: write | |
| env: | |
| REGISTRY_OWNER: ${{ github.repository_owner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lowercase owner | |
| run: echo "REGISTRY_OWNER=${REGISTRY_OWNER,,}" >> $GITHUB_ENV | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/${{ env.REGISTRY_OWNER }}/agentic-taf:${{ github.ref_name }} | |
| ghcr.io/${{ env.REGISTRY_OWNER }}/agentic-taf:latest |