Feat/documentation #1
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: AMP Instrumentation Package | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| paths: | |
| - "libs/amp-instrumentation/**" | |
| - ".github/workflows/amp-instrumentation-package-pr-checks.yaml" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: libs/amp-instrumentation | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Run ruff linter | |
| run: ruff check . | |
| - name: Run ruff formatter check | |
| run: ruff format --check . | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| defaults: | |
| run: | |
| working-directory: libs/amp-instrumentation | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-cov | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=src --cov-report=html --cov-report=term | |
| - name: Upload coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: amp-instrumentation-coverage-py${{ matrix.python-version }} | |
| path: libs/amp-instrumentation/htmlcov | |
| retention-days: 7 | |
| type-check: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: libs/amp-instrumentation | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install mypy | |
| - name: Run mypy | |
| run: mypy src --install-types --non-interactive | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: libs/amp-instrumentation | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: amp-instrumentation-dist | |
| path: libs/amp-instrumentation/dist | |
| retention-days: 7 |